Skip to content

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

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 19, 2023

The PR is quite straight-forward, but I think that others should decide on which wording is best:

  • It got me confused
  • Looks like no other user had reported this issue for like 20 years

Copy link
Member

@AlexWaygood AlexWaygood left a 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.

Copy link
Member

@hugovk hugovk left a 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.

@hugovk
Copy link
Member

hugovk commented Nov 19, 2023

Backport? This seems like a docs fix, or a bug fix, both which should be backported.

@AlexWaygood
Copy link
Member

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 help() on a class... but they probably shouldn't be doing that, anyway 😄 So yes, I think we're good to backport this

@AlexWaygood AlexWaygood added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 19, 2023
@AlexWaygood AlexWaygood merged commit f812914 into python:main Nov 19, 2023
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f8129146ef9e1b71609ef4becc5d508061970733 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 19, 2023
…akref__` docstrings (pythonGH-112268)

(cherry picked from commit f812914)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Nov 19, 2023

GH-112270 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 19, 2023
@AlexWaygood
Copy link
Member

Are you okay to take care of the 3.11 backport, @sobolevn? :)

AlexWaygood pushed a commit that referenced this pull request Nov 19, 2023
…eakref__` docstrings (GH-112268) (#112270)

gh-112266: Remove `(if defined)` part from `__dict__` and `__weakref__` docstrings (GH-112268)
(cherry picked from commit f812914)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@sobolevn
Copy link
Member Author

Yes, will do later

sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 20, 2023
@bedevere-app
Copy link

bedevere-app bot commented Nov 20, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Nov 20, 2023
AlexWaygood pushed a commit that referenced this pull request Nov 20, 2023
@hugovk
Copy link
Member

hugovk commented Dec 11, 2023

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 help() on a class... but they probably shouldn't be doing that, anyway 😄 So yes, I think we're good to backport this

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 sys.version_info check.

@hugovk
Copy link
Member

hugovk commented Dec 11, 2023

Created PR sphinx-doc/sphinx#11793.

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants