I want to annotate my function using type hints. I am running into a problem where I am using a function as input parameters (or more specifically, a class-method), and I do not know how I should define the type hint. The code is as follows:
async def get_mails(api: SomeApi,
all_contacts: ContactDict,
query_function: ???,
aggregate_function: ???) -> list:
customer_emails = await query_function()
for customer_email in customer_emails:
for email in await get_emails_by_customer(api, customer_email, get_employees()):
all_contacts[customer_email].add_mail(email)
return aggregate_function()
I added ??? Where I want to add the type hint for the functions.