generate_data
should receive the bound method, not the result of calling the method, as an argument, then call the received argument inside the function:
def generate_data(faker_function):
return [faker_function() for _ in range(5)]
generate_data(Faker().credit_card_number)
4
solved Creating a function that takes another function as an argument