Skip to content

"function" is not assignable to "FunctionType" - is this a bug? #9703

Answered by erictraut
Andrej730 asked this question in Q&A
Discussion options

You must be logged in to vote

No, this isn't a bug. The types defined in the types module should generally not be used for type checking purposes. They represent internal implementation types for Python. You should use types defined in the typing module for type annotations instead. In this case, use typing.Callable.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Andrej730
Comment options

@erictraut
Comment options

@Andrej730
Comment options

Answer selected by Andrej730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants