-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make operator overloading overlapping checks more lenient #1264
Comments
mkurek
pushed a commit
to mkurek/typeshed
that referenced
this issue
Dec 21, 2016
Improve operator methods for dateutil.relativedelta stubs: * `__add__` operator method could return other types than `relativedelta` (`datetime.date` or `datetime.datetime`) * use specific types of operators args instead of Any * mypy currently does not handle `Union` in op methods (see python/mypy#2129, python/mypy#1442, python/mypy#1264 for details), so I've overloaded it directly
ambv
pushed a commit
to python/typeshed
that referenced
this issue
Dec 28, 2016
Improve operator methods for dateutil.relativedelta stubs: * `__add__` operator method could return other types than `relativedelta` (`datetime.date` or `datetime.datetime`) * use specific types of operators args instead of Any * mypy currently does not handle `Union` in op methods (see python/mypy#2129, python/mypy#1442, python/mypy#1264 for details), so I've overloaded it directly
I think all issues here are now resolved. We can open new issues if some complains about too strict overload checks will appear. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the overlapping checks for
__add__
/__radd__
and similar make it impossible to have reasonable types for thefractions
std lib module (and probably alsonumbers
).There are several potential related issues:
This is just a placeholder issue -- I'll add more detail later. Perhaps create separate issues for all the above issues.
The text was updated successfully, but these errors were encountered: