-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overloading staticmethods #7781
Comments
It looks like it only works right now if you call it directly via the class: |
@Michael0x2a Any chance you are excited to take another look at this thrilling interaction? |
I have also ran into this problem. Any chance it gets addressed? |
bug stil exists in mypy 0.812 |
My current workaround is to write an overloaded function (outside of the class body) instead of an overloaded staticmethod. |
This bug still appears to exist in mypy 0.931, python 3.10x :( |
This is also a problem for typeshed: python/typeshed#7543. |
Problem still present for mypy 0.961, python 3.10.2
Line 35 is the |
Had this issue too (0.961 3.10.5), only crops up on instances of the class, not the class itself |
…untime * tim/SessionClientDisconnectedError: better docstring typo SessionClientDisconnectedError, with test WIP * Remove staticmethod decorator from __call__ method of SingletonAPI to avoid mypy bug python/mypy#7781 (streamlit#4981)
Overloaded staticmethod isn't considered correctly by the type checker.
foobar.py
While running
mypy foobar.py
expected output:Success: no issues found in 1 source file
,but got
foobar.py:21: error: No overload variant of "snafu" of "Snafu" matches argument type "str"
.I guessed #5224 had to fix this, but i've got the behavior above.
Am i doing something wrong?
mypy v0.740, Python v3.7.4
The text was updated successfully, but these errors were encountered: