GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-86690: pdb: additional documentation on retval by romuald · Pull Request #27612 · python/cpython Conversation
|
| """retval | ||
| Print the return value for the last return of a function. | ||
| Alternatively, the return value can be accessed with the local | ||
| variable ``__return__`` |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ... 'jump 8', # jump over second for loop | ||
| ... 'return', # return out of function | ||
| ... 'retval', # display return value | ||
| ... '__return__', # access the return value |
There was an error while loading. Please reload this page.
There was a problem 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 between retval and __return__).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following commit authors need to sign the Contributor License Agreement: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.