-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Conversation
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 would suggest synchronizing what is being written in the docstring with what is being written in inspect.rst and have the same wording.
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>
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.
Looks good to me now. I'll let @AA-Turner review one last time in case I missed English typos.
Co-authored-by: Victor Stinner <vstinner@python.org>
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 |
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.
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.
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.
LGTM
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. |
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. |
…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>
…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>
Lib/inspect.py
#122058