| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Add documentation on `retval`stating 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()`)
| """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.
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.
| ... 'jump 8', # jump over second for loop | ||
| ... 'return', # return out of function | ||
| ... 'retval', # display return value | ||
| ... '__return__', # access the return value |
There was a problem hiding this comment.
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.
|
The following commit authors need to sign the Contributor License Agreement: |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add documentation on retvalstating 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