-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
CI: Test on Cython 3.0 on numpydev #46029
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
Changes from 1 commit
cdd46ba
27a674b
d22e588
646dced
8328092
4a87227
d5a9c7e
51ce2b2
5aa9f13
de88da9
ae3e6fa
89891f7
dc7517a
416bca5
9599b74
127e97b
84d742d
6a2cb90
fd22fdb
fa2c1e2
0e3b56a
a154bb2
7259c4c
f123a47
313b8eb
00c492d
71cee4e
7f10301
92325d7
eaea742
db69f58
f467452
7bc1609
9557ae9
efd227a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1739,6 +1739,7 @@ cdef class _Period(PeriodMixin): | |
def __add__(self, other): | ||
if not is_period_object(self): | ||
# cython semantics; this is analogous to a call to __radd__ | ||
# TODO: Cython3, remove this | ||
if self is NaT: | ||
return NaT | ||
return other.__add__(self) | ||
|
@@ -1763,6 +1764,11 @@ cdef class _Period(PeriodMixin): | |
|
||
return NotImplemented | ||
|
||
def __radd__(self, other): | ||
if other is NaT: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks harmless, but is it necessary? would falling through to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think falling through works. (I vaguely remember some tests failing because of this) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you double-check and add a comment for when future-me thinks this looks weird and doesn't remember this thread There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. Looks like this might work? Checking with CI. |
||
return NaT | ||
return self.__add__(other) | ||
|
||
def __sub__(self, other): | ||
if not is_period_object(self): | ||
# cython semantics; this is like a call to __rsub__ | ||
|
@@ -1789,6 +1795,11 @@ cdef class _Period(PeriodMixin): | |
|
||
return NotImplemented | ||
|
||
def __rsub__(self, other): | ||
if other is NaT: | ||
return NaT | ||
return NotImplemented | ||
|
||
def asfreq(self, freq, how='E') -> "Period": | ||
""" | ||
Convert Period to desired frequency, at the start or end of the interval. | ||
|
Uh oh!
There was an error while loading. Please reload this page.