El sáb, 19 jun 2021 a las 3:28, Daniel Mouritzen (<dmrtzn@gmail.com>) escribió:
I think it's important to be aware of the subtle differences between function type annotations and callable types. The type annotations on a function definition (or stub) define all the possible ways the function can be called. Callable types on the other hand define one particular way a function can be called. When you're writing type annotations for a callback argument, you base it on how the callback will be called, not how any particular function is defined.

These differences also mean we have slightly different requirements from the syntax. A function definition can have three types of arguments: positional-or-keyword arguments (the default), positional-only arguments and keyword-only arguments. For a callable type on the other hand there are two types (which correspond to how the function will actually be called): positional arguments and keyword arguments.

You're implicitly assuming here that a given callable type is only being called in one way.  But that's not necessarily true: a large codebase can contain a callable type that is being called in different ways in different places. For example, a callback could be called sometimes with named and sometimes with positional arguments; an argument with a default is sometimes omitted and sometimes is not; et cetera.