-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: remove replace_list kludge #33445
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 generally good
pandas/_libs/tslibs/timedeltas.pyx
Outdated
@@ -778,36 +778,32 @@ cdef class _Timedelta(timedelta): | |||
|
|||
if isinstance(other, _Timedelta): | |||
ots = other | |||
elif PyDelta_Check(other) or isinstance(other, Tick): | |||
elif (is_timedelta64_object(other) or PyDelta_Check(other) |
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.
Any performance implications of checking this first now?
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.
when we have a timedelta64 object we're avoiding a few unnecessary checks below (L784 of which occurs in python-space). otherwise we are delaying everything by the duration of a is_timedelta64_object
call, which is small
can you rebase so easier to see the diff |
This sits on top of #33441