Skip to content

bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList #30452

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

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

ariebovenberg
Copy link
Contributor

@ariebovenberg ariebovenberg commented Jan 7, 2022

Confirmed with @jaraco that this indeed needs a fix.

A question that came up while I was digging into the code: I think SelectableGroups could similarly use __slots__ = (), since its purpose seems only for convenience around dict, not to have attributes of its own.

https://bugs.python.org/issue46246

Automerge-Triggered-By: GH:jaraco

@AlexWaygood AlexWaygood requested a review from jaraco January 7, 2022 12:58
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to automate this check? What do you think?

@ariebovenberg
Copy link
Contributor Author

ariebovenberg commented Jan 7, 2022

@sobolevn it might indeed be worthwhile to add a test that walks the whole stdlib for these kind of simple __slots__ mistakes.

It'd be out of scope of this PR so I'll float the idea on bugs.python.org

edit: link to said ticket: https://bugs.python.org/issue46298

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 11, 2022
@jaraco
Copy link
Member

jaraco commented Feb 11, 2022

I've backported the change to importlib_metadata and published as v4.11.0. Thanks for the contrib.

@jaraco jaraco added the needs backport to 3.10 only security fixes label Feb 11, 2022
@miss-islington
Copy link
Contributor

@ariebovenberg: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit dd76b3f into python:main Feb 11, 2022
@miss-islington
Copy link
Contributor

Thanks @ariebovenberg for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 11, 2022
…pythonGH-30452)

Confirmed with @jaraco that this indeed needs a fix.

A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.

Automerge-Triggered-By: GH:jaraco
(cherry picked from commit dd76b3f)

Co-authored-by: Arie Bovenberg <a.c.bovenberg@gmail.com>
@bedevere-bot
Copy link

GH-31269 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 11, 2022
miss-islington added a commit that referenced this pull request Feb 11, 2022
…GH-30452)

Confirmed with @jaraco that this indeed needs a fix.

A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.

Automerge-Triggered-By: GH:jaraco
(cherry picked from commit dd76b3f)

Co-authored-by: Arie Bovenberg <a.c.bovenberg@gmail.com>
@ariebovenberg ariebovenberg deleted the fix-issue-46246 branch February 11, 2022 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants