-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Move chained assignment detection to cython for Python 3.14 compat #62070
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
base: main
Are you sure you want to change the base?
Move chained assignment detection to cython for Python 3.14 compat #62070
Conversation
pandas/_libs/internals.pyx
Outdated
# @cython.auto_pickle(False) | ||
cdef class SetitemMixin: | ||
|
||
def __setitem__(self, key, value): |
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.
can this be made cdef? small perf improvement i think. downside is i think it becomes harder for subclassers who want to override it. But after this PR, they should be overriding _setitem instead
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.
No, special (dunder) methods need to be specified as def
(That's also what I would have expected since this method should be callable from python, but even cpdef gives a cython compilation error "Special methods must be declared with 'def', not 'cdef'")
Some commented-out code needs to be removed, otherwise looks nice |
66cd359
to
efea93f
Compare
Draft exploring a solution for #61368