-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-112266: Remove (if defined)
part from __dict__
and __weakref__
docstrings
#112268
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
Conversation
…akref__` docstrings
8616001
to
d6c7406
Compare
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.
I like this change. While I don't personally find the existing text unclear, I can see how it could be confusing for some. This change also makes the docstrings more concise, which is generally a good thing; and I honestly don't think the "(if defined)" really provides any additional information, anyway.
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.
There is ambiguity of whether it applies to the dictionary, or the instance variables, so fine to remove it.
Backport? This seems like a docs fix, or a bug fix, both which should be backported. |
I suppose it could break people's tests if they're asserting the exact output of |
Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to
|
…akref__` docstrings (pythonGH-112268) (cherry picked from commit f812914) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
GH-112270 is a backport of this pull request to the 3.12 branch. |
Are you okay to take care of the 3.11 backport, @sobolevn? :) |
Yes, will do later |
…d `__weakref__` docstrings (pythonGH-112268)
GH-112276 is a backport of this pull request to the 3.11 branch. |
Sphinx says 👋 Their tests have started failing on 3.11-3.13, they have some: assert ' list of weak references to the object (if defined)' in actual https://github.com/sphinx-doc/sphinx/actions/runs/7158385030/job/19490408092?pr=11791 I'll open a PR to fix their tests with a |
Created PR sphinx-doc/sphinx#11793. |
…akref__` docstrings (python#112268)
…akref__` docstrings (python#112268)
The PR is quite straight-forward, but I think that others should decide on which wording is best:
help()
on types has strange(if defined)
notice for attributes that are defined #112266