-
-
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
int
is not compatable with float
#11145
Comments
Probably the best solution is to add the |
for method in dir(float):
try:
getattr(int, method)
except AttributeError as e:
print(e)
|
for method in dir(bytes):
try:
getattr(memoryview, method)
except AttributeError as e:
print(e)
|
FYI |
I think this functionality is absurd, nowhere else is duck typing used. It seems extremely inconsistent. |
typing-sig is a better place for this discussion (or bugs.python.org if the solution is to add new methods to builtins). mypy can't make changes to behaviour that is specified by PEPs. The bool stuff is separate, since bool actually is a subtype of int at runtime. |
https://mypy.readthedocs.io/en/stable/duck_type_compatibility.html
No it's not:
The text was updated successfully, but these errors were encountered: