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

gh-96397: Document that attributes need not be identifiers #96454

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

jeff5
Copy link
Contributor

@jeff5 jeff5 commented Aug 31, 2022

Companion to #96393, and stemming from points made in the discussions at https://discuss.python.org/t/supporting-or-not-invalid-identifiers-in-kwargs/17147/26 and #96397, this proposes extending how we define "attribute" to match the behaviour of implementations and some current user practice.

Needs SC discussion, I believe.

Clarify that the name of an attribute need not be a valid Python identifier, in particular through setarr(), noting that this precludes use of the dot notation to access them.
Copy link
Contributor

@ChrisBarker-NOAA ChrisBarker-NOAA left a comment

Choose a reason for hiding this comment

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

Looks good to me -- I've suggested a bit more verbose text, but not critical.

@jeff5
Copy link
Contributor Author

jeff5 commented Sep 29, 2022

Could this be merged, or have I more to do?

@merwok merwok requested a review from gvanrossum September 29, 2022 17:01
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

LGTM, one optional suggestion.

@gvanrossum gvanrossum merged commit 9a11ed8 into python:main Sep 29, 2022
@gvanrossum gvanrossum added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Sep 29, 2022
@miss-islington
Copy link
Contributor

Thanks @jeff5 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @jeff5 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Sep 29, 2022
@bedevere-bot
Copy link

GH-97659 is a backport of this pull request to the 3.11 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants