Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-39278: add docstrings to functions in pdb module #17924
Conversation
Thanks for the PR @carlbordum. IMO, it's always helpful to keep the docstrings up to date with the documentation. I've verified that the changes match the documentation at https://docs.python.org/3/library/pdb.html. The only thing that's missing is a few formatting conversions, particularly the words that should be italics. In docstrings, we typically surround parameter names with asterisks (only for the first occurrence in each docstring though). I'll include the missing ones in suggestions below. The only other thing you could consider including would be a docstring for the |
return Pdb().runeval(expression, globals, locals) | ||
|
||
def runctx(statement, globals, locals): | ||
# B/W compatibility | ||
run(statement, globals, locals) | ||
|
||
def runcall(*args, **kwds): | ||
"""Call the function (a function or method object, not a string) |
This comment has been minimized.
This comment has been minimized.
aeros
Jan 9, 2020
Member
"""Call the function (a function or method object, not a string) | |
"""Call the *function* (a function or method object, not a string) |
This comment has been minimized.
This comment has been minimized.
carlbordum
Jan 10, 2020
Author
Contributor
Thanks for the review! I went ahead and changed what you asked for except for this one case. I am not sure "function" should be italic as the name is not in the signature. What do you think?
This comment has been minimized.
This comment has been minimized.
aeros
Jan 12, 2020
Member
Thanks for the review!
No problem, thanks for making the recommended changes.
I am not sure "function" should be italic as the name is not in the signature. What do you think?
Personally, I'm a bit undecided on this one since it's in the function signature for the documentation: https://docs.python.org/3/library/pdb.html?highlight=runcall#pdb.runcall, I'm not certain why there's a discrepancy here between the docs and the source code.
Perhaps someone experienced with pdb can provide clarification. In the meantime, it's probably fine to leave it out.
All these functions were already documented, but not in docstrings which means you could not call help() on the functions before this patch.
This comment has been minimized.
This comment has been minimized.
@vstinner Based on the build logs at https://github.com/python/cpython/pull/17924/checks?check_run_id=382949957 and https://travis-ci.org/python/cpython/jobs/635143388?utm_medium=notification&utm_source=github_status, the failures look to be unrelated to the PR. I suspect the "Install Dependencies" failure would likely be resolved if we re-triggered the CI checks, but the doc build failure in "library/nntplib.rst" might be a bit more involved:
Can we retrigger the tests here or would you suggest opening a bug report (if there's not one already)? |
carlbordum commentedJan 9, 2020
•
edited by bedevere-bot
All these functions were already documented, but not in docstrings which
means you could not call help() on the functions before this patch.
https://bugs.python.org/issue39278