Skip to content
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

bpo-27275: Change popitem() and pop() methods of collections.OrderedDict #27530

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Aug 1, 2021

For consistency with dict both implementations (pure Python and C)
of these methods in OrderedDict no longer call __getitem__ and
__delitem__ methods of the OrderedDict subclasses.

Previously only the Python implementation of popitem() did not
call them.

https://bugs.python.org/issue27275

…tem().

The C implementation no longer calls ``__getitem__`` and ``__delitem__``
methods of the OrderedDict subclasses.
For consistency with dict both implementations (pure Python and C)
of these methods in OrderedDict no longer call __getitem__ and
__delitem__ methods of the OrderedDict subclasses.

Previously only the Python implementation of popitem() did not
call them.
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Aug 1, 2021
@ambv ambv removed needs backport to 3.10 only security fixes needs backport to 3.9 only security fixes labels Aug 3, 2021
@ambv
Copy link
Contributor

ambv commented Aug 3, 2021

Based on Raymond's comment on the issue, we won't be backporting this as it's a behavioral change and there haven't been reports complaining of the old behavior.

@mhvk
Copy link

mhvk commented Sep 11, 2022

See astropy/astropy#13637 for a regression caused by this change. We may be able to work around this, but on the other hand we're unlikely to be the only project that counts on __delitem__ being called when something is being pop'd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants