You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason being, the documentation states « Callback protocols and Callable types can be used interchangeably. » ; which I naively interpret as "P is a Callable" (for most intents and purposes) which should make this error message impossible.
To Reproduce
Check mypy-play link above, but given I don't know how long these last, see following example:
An error that (IMHO) seems to go against what the documentation hints to. (I insist on that point because it could simply be that documentation needs a fix, not implementation)
main.py:19: error: Argument 1 to "f" has incompatible type "Callable[[], None]"; expected "P" [arg-type]
Your Environment
Mypy version used: 0.931 & mypy-play
Mypy command-line flags: --strict .
Mypy configuration options from mypy.ini (and other config files): -
Python version used: 3.9
Operating system and version: Gentoo
The text was updated successfully, but these errors were encountered:
Bug Report
Hello and apologies in advance if this is somewhat normal and/or I missed the proper way to type-hint this, but my gut instinct says that this should work: https://mypy-play.net/?mypy=latest&python=3.10&gist=19147e0d445ef5a57cb6a3fecb346436&flags=show-error-codes
The reason being, the documentation states « Callback protocols and Callable types can be used interchangeably. » ; which I naively interpret as "P is a Callable" (for most intents and purposes) which should make this error message impossible.
To Reproduce
Check mypy-play link above, but given I don't know how long these last, see following example:
Expected Behavior
No error, given P is a Callable?
Actual Behavior
An error that (IMHO) seems to go against what the documentation hints to. (I insist on that point because it could simply be that documentation needs a fix, not implementation)
main.py:19: error: Argument 1 to "f" has incompatible type "Callable[[], None]"; expected "P" [arg-type]
Your Environment
mypy.ini
(and other config files): -The text was updated successfully, but these errors were encountered: