Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-101100: Fix reference warnings for__getitem__#110118

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 1 commit intopython:mainfromAA-Turner:docs/refwarn/__getitem__
Oct 19, 2023

Conversation

AA-Turner
Copy link
Member

@AA-TurnerAA-Turner commentedSep 29, 2023
edited by bedevere-appbot
Loading

@AA-TurnerAA-Turner added needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsSep 29, 2023
@bedevere-appbedevere-appbot added awaiting review docsDocumentation in the Doc dir skip news labelsSep 29, 2023
@AA-TurnerAA-Turner removed request fora team andrhettingerSeptember 29, 2023 18:16
@AA-TurnerAA-Turner changed the titleFix reference warnings for__getitem__GH-101100: Fix reference warnings for__getitem__Sep 29, 2023
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Previously, there was no need to add theobject. prefix. Allobject methods were automatically found. I don't know why it broke and from where. If someone could fix this, it would save us from rewriting a lot of references.

@AA-Turner
Copy link
MemberAuthor

AA-Turner commentedSep 30, 2023
edited
Loading

Do you have a rough idea of when it was working? (2010? 2015? 2020?) I could look at this, but unbounded I fear it'd be a fairly time consuming activity.

Prepending references with~object. is a fairly easy mechanical task, though I appreciate it adds noise. From what I understand of Sphinx though, it does seem the 'proper' thing to do.

Perhaps of interest, this is a table of the frequency of dunder attributes that cause reference warnings (I've filtered a little but not properly):

CountTypeTarget
32meth__exit__
31meth__getitem__
26meth__enter__
21meth__get__
21meth__init__
20meth__iter__
20meth__getattr__
20meth__new__
16attr__doc__
15meth__getattribute__
13meth__repr__
12attr__cause__
12meth__set__
12meth__contains__
11attr__annotations__
11meth__hash__
10attr__module__
10attr__context__
10meth__eq__
10meth__len__
10attr__self__
8meth__reduce__
7meth__str__
7meth__add__
7attr__func__
6attr__traceback__
6meth__delete__
6meth__reversed__
6meth__dir__
6meth__lt__
6meth__await__
6meth__setstate__
6meth__missing__
6meth__setitem__
6meth__index__
5meth__set_name__
5meth__radd__
5meth__getstate__
5meth__cmp__
4meth__call__
4meth__le__
4meth__ge__
4meth__format__
4meth__delitem__
4meth__int__
3attr__suppress_context__
3attr__members__
3meth__getnewargs__
3attr__wrapped__
3meth__gt__
3meth__setattr__
3meth__or__
3attr__code__
3meth__ne__
3meth__truediv__
3meth__unicode__
2meth__reduce_ex__
2attr__isabstractmethod__
2meth__and__
2attr__notes__
2func__getattr__
2attr__defaults__
2attr__globals__
2attr__closure__
2attr__type_params__
2meth__floordiv__
2meth__iadd__
2attr__methods__
2meth__coerce__
2meth__complex__
2meth__hex__
2meth__oct__
2meth__matmul__
1meth__next__
1meth__subclasscheck__
1meth__aenter__
1meth__aexit__
1meth__abs__
1func__getattribute__
1meth__getnewargs_ex__
1meth__bytes__
1meth__fspath__
1attr__kwdefaults__
1meth__pow__
1meth__neg__
1meth__pos__
1meth__invert__
1meth__mul__
1meth__rmul__
1meth__mod__
1meth__sub__
1meth__lshift__
1meth__rshift__
1meth__rand__
1meth__xor__
1meth__rxor__
1meth__ror__
1meth__isub__
1attr__metaclass__
1attr__class__
1meth__sizeof__
1data__metaclass__
1meth__getslice__
1meth__setslice__
1meth__delslice__
1func__repr__
1func__str__
1meth__del__
1meth__rmatmul__
1meth__imatmul__
1meth__rmod__
1meth__divmod__
1meth__aiter__
1attr__all__
1meth__class_getitem__

A

@serhiy-storchaka
Copy link
Member

Perhaps it worked 10 years ago. There were more Python specific code in Doc/tools/extensions, and Sphinx itself was more Python-oriented. Or maybe it was just a legend, I don't remember.

@serhiy-storchaka
Copy link
Member

It perhaps worked by accident on old Sphinx versions.

@serhiy-storchaka
Copy link
Member

LGTM.

@AA-Turner, are you going to create a separate PR for every dunder method? Some lines contain references to several dunder methods (for example__getitem__,__iter__,__len__,__setitem__). The same line can be modified several times in a series of PRs. It will make reading history more difficult. Why not merge changes for several related methods in one PR?

@hugovkhugovk merged commitda99133 intopython:mainOct 19, 2023
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 19, 2023
…-110118)(cherry picked from commitda99133)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 19, 2023
…-110118)(cherry picked from commitda99133)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app
Copy link

GH-111073 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelOct 19, 2023
@bedevere-app
Copy link

GH-111074 is a backport of this pull request to the3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelOct 19, 2023
hugovk pushed a commit that referenced this pull requestOct 19, 2023
…) (#111073)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
hugovk pushed a commit that referenced this pull requestOct 19, 2023
…) (#111074)Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@hugovkhugovkhugovk approved these changes

@ezio-melottiezio-melottiAwaiting requested review from ezio-melotti

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@AA-Turner@serhiy-storchaka@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp