typing.Callable: Specify an Input is of Type Function

typing is a Python module that allows developers to specify the types of inputs to make sure the input types are correct. To specify an input is of type function, use typing.Callable.

Callable can be used static type checker such as mypy to check if the input is indeed a function.

Related Posts

Related Posts

Scroll to Top