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-122058: Lib/inspect: Update docstrings for isfunction, isgenerator, isframe, iscode. #122059

Merged
merged 11 commits into from
Aug 6, 2024

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Jul 20, 2024

Lib/inspect.py Outdated Show resolved Hide resolved
Copy link
Contributor

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I would suggest synchronizing what is being written in the docstring with what is being written in inspect.rst and have the same wording.

Lib/inspect.py Outdated Show resolved Hide resolved
Lib/inspect.py Outdated Show resolved Hide resolved
Lib/inspect.py Show resolved Hide resolved
Lib/inspect.py Outdated Show resolved Hide resolved
Lib/inspect.py Outdated Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Eclips4 and others added 4 commits July 27, 2024 11:40
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@Eclips4 Eclips4 requested a review from picnixz July 27, 2024 08:50
Copy link
Contributor

@picnixz picnixz 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 now. I'll let @AA-Turner review one last time in case I missed English typos.

Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/library/inspect.rst Show resolved Hide resolved
Lib/inspect.py Outdated Show resolved Hide resolved
Eclips4 and others added 3 commits July 27, 2024 23:49
send resumes the generator and "sends" a value that becomes
gi_yieldfrom object being iterated by yield from or None

__iter__() defined to support iteration over container
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: I've grouped methods, but I'm not sure if __iter__ really needs to be here. If __iter__ is here, then we also need to add __next__. Our inspect documentation does not mention the __next__ method for generators. In my opinion, we should remove this method from the docstring since it does not make things clearer.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner
Copy link
Member

About backports, backporting inspect.rst changes LGTM, but I'm not sure about changing docstrings. Maybe docstrings should be left unchanged in 3.12 and 3.13 branches, especially in the 3.12 branch.

@vstinner vstinner removed needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Aug 6, 2024
@vstinner vstinner merged commit 8ce70d6 into python:main Aug 6, 2024
41 checks passed
@vstinner
Copy link
Member

vstinner commented Aug 6, 2024

Merged, thanks.

I removed automated backported. As I wrote previously, if you want, you can backport .rst changes, but not .c files (docstrings), in stable branches.

@Eclips4 Eclips4 deleted the update-docstring branch August 6, 2024 17:04
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
…isgenerator`, `isframe`, `iscode`. (python#122059)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…isgenerator`, `isframe`, `iscode`. (python#122059)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants