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

bpo-42524: pdb: additional documentation on retval#27612

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

Open
romuald wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromromuald:pdb-retval-doc

Conversation

romuald
Copy link
Contributor

@romualdromuald commentedAug 5, 2021
edited by bedevere-bot
Loading

Add documentation onretvalstating that the return value itself can be
accessed via the__return__ local variable.

This is intended to let people know that they can access complex objects
using this variable (for example access__return__.thingy())

https://bugs.python.org/issue42524

Add documentation on `retval`stating that the return value itself can beaccessed via the `__return__` local variable.This is intended to let people know that they can access complex objectsusing this variable (for example access `__return__.thingy()`)
@@ -1238,6 +1238,8 @@ def do_args(self, arg):
def do_retval(self, arg):
"""retval
Print the return value for the last return of a function.
Alternatively, the return value can be accessed with the local
variable ``__return__``
Copy link
Member

Choose a reason for hiding this comment

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

Actually this sentence fits better in the documentation here:https://docs.python.org/3/library/pdb.html#pdbcommand-retval

For the docstring it's not really appropriate to point to an alternative.

serhiy-storchaka reacted with thumbs up emoji
@@ -107,6 +107,7 @@ def test_pdb_basic_commands():
... 'jump 8', # jump over second for loop
... 'return', # return out of function
... 'retval', # display return value
... '__return__', # access the return value
Copy link
Member

@iritkatrieliritkatrielAug 26, 2021
edited
Loading

Choose a reason for hiding this comment

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

Because the function returns a string, this test doesn't really check that__return__ is the value rather than the string representation of the value. It also doesn't check that you can assign it to a local and inspect it (in other words - the test doesn't show that there is a difference betweenretval and__return__).

serhiy-storchaka reacted with thumbs up emoji
@romualdromualdmannequin mentioned this pull requestApr 10, 2022
@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@romuald@iritkatriel@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp