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-45198: __set_name__ documentation not clear about its usage with non-descriptor classes #28439

Merged
merged 3 commits into from
Sep 18, 2021

Conversation

rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Sep 18, 2021

  • Change descriptor specific wording and examples to cover the general case.
  • Fix broken example for calling __set_name__ directly. The example was descriptor specific and the invocation could fail because the descriptor would be triggered by the dotted lookup on the class.
  • Move the __set_name__ docs out of the descriptor section and into the general section on class creation.

https://bugs.python.org/issue45198

@rhettinger rhettinger merged commit 94b4626 into python:main Sep 18, 2021
@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 18, 2021
…non-descriptor classes (pythonGH-28439)

(cherry picked from commit 94b4626)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@miss-islington
Copy link
Contributor

Sorry, @rhettinger, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 94b462686b7dfabbd69cc9401037d736d71c4dc2 3.9

@bedevere-bot
Copy link

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

miss-islington added a commit that referenced this pull request Sep 18, 2021
…non-descriptor classes (GH-28439)

(cherry picked from commit 94b4626)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
niyas-sait pushed a commit to niyas-sait/cpython that referenced this pull request Sep 21, 2021
pablogsal pushed a commit that referenced this pull request Sep 29, 2021
…non-descriptor classes (GH-28439)

(cherry picked from commit 94b4626)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@ZeroIntensity ZeroIntensity removed the needs backport to 3.9 only security fixes label Feb 17, 2025
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.

5 participants