mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#18796: improve documentation of the file argument of dis.show_code. Initial patch by Vajrasky Kok.
This commit is contained in:
parent
f79126f373
commit
6e6c6ac3d7
2 changed files with 6 additions and 2 deletions
|
@ -146,7 +146,10 @@ def _format_code_info(co):
|
|||
return "\n".join(lines)
|
||||
|
||||
def show_code(co, *, file=None):
|
||||
"""Print details of methods, functions, or code to stdout."""
|
||||
"""Print details of methods, functions, or code to *file*.
|
||||
|
||||
If *file* is not provided, the output is printed on stdout.
|
||||
"""
|
||||
print(code_info(co), file=file)
|
||||
|
||||
_Instruction = collections.namedtuple("_Instruction",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue