-
-
Notifications
You must be signed in to change notification settings - Fork 141
make sub of timedelta work #759
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but there might be a numpy-pyright error
Actually, it was an issue with pyright 1.1.320. Needed to test differently on mypy vs. pyright, which I figured out how to do. Take another look |
|
||
SupportsRichComparison: TypeAlias = Any | ||
else: | ||
from _typeshed import SupportsRichComparison # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind referencing an issue or describing the discrepancy? Is it just that mypy has an older version of typestubs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also work for poe mypy --mypy_nightly
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments in 5310eb6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also work for
poe mypy --mypy_nightly
?
Looks like it did!
We may want to use this pattern (MYPY_CHECKING
) elsewhere when mypy
and pyright
make different inferences. Can't put it in the stubs themselves - that would require users to define MYPY_CHECKING
as false
if using pyright, but we can use it in our tests.
Thanks @Dr-Irv ! |
assert_type()
to assert the type of any return valuetest_timefuncs.py:test_timedelta64_and_arithmatic_operator()
- added tests there