The init function inside a Class is annotated the following way:
def __init__(self, directory: str, transforms: Callable = None, extension: str = '.jpg'):
The question is what Callable = None
is referring to.
Conventionally if the transforms
- argument annotation would mean to intake a Callable (i.e. a function) then the input parameters would need to be defined as well as the output, as an example it could be: transforms: Callable[[int,int], int]
where the [int,int] would be the function parameters as input, and the latter
int` would be the return. But here this is not the case.
What does the Callable
annotation expect as input and return in this case?
According to Python Documentation
A plain Callable is equivalent to Callable[..., Any], and in turn to collections.abc.Callable.