FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-133438: Fix the use of the terms "argument" and "parameter" in dis.show_code() by serhiy-storchaka · Pull Request #135170 · python/cpython · GitHub

/ cpython Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 3 additions & 3 deletions Lib/dis.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ def _format_code_info(co):
lines = []
lines.append("Name: %s" % co.co_name)
lines.append("Filename: %s" % co.co_filename)
lines.append("Argument count: %s" % co.co_argcount)
lines.append("Positional-only arguments: %s" % co.co_posonlyargcount)
lines.append("Kw-only arguments: %s" % co.co_kwonlyargcount)
lines.append("Positional parameters: %s" % co.co_argcount)
lines.append("Positional-only parameters: %s" % co.co_posonlyargcount)
lines.append("Keyword-only parameters: %s" % co.co_kwonlyargcount)
lines.append("Number of locals: %s" % co.co_nlocals)
lines.append("Stack size: %s" % co.co_stacksize)
lines.append("Flags: %s" % pretty_flags(co.co_flags))
Expand Down
42 changes: 21 additions & 21 deletions Lib/test/test_dis.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1461,9 +1461,9 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
code_info_code_info = f"""\
Name: code_info
Filename: (.*)
Argument count: 1
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 1
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 1
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS, HAS_DOCSTRING
Expand All @@ -1485,9 +1485,9 @@ def f(c=c):
code_info_tricky = """\
Name: tricky
Filename: (.*)
Argument count: 5
Positional-only arguments: 2
Kw-only arguments: 3
Positional parameters: 5
Positional-only parameters: 2
Keyword-only parameters: 3
Number of locals: 10
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS, VARARGS, VARKEYWORDS, GENERATOR
Expand Down Expand Up @@ -1520,9 +1520,9 @@ def f(c=c):

code_info_tricky_nested_f = """\
Filename: (.*)
Argument count: 1
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 1
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 1
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS, NESTED
Expand All @@ -1543,9 +1543,9 @@ def f(c=c):
code_info_expr_str = """\
Name: <module>
Filename: <disassembly>
Argument count: 0
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 0
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 0
Stack size: \\d+
Flags: 0x0
Expand All @@ -1557,9 +1557,9 @@ def f(c=c):
code_info_simple_stmt_str = """\
Name: <module>
Filename: <disassembly>
Argument count: 0
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 0
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 0
Stack size: \\d+
Flags: 0x0
Expand All @@ -1572,9 +1572,9 @@ def f(c=c):
code_info_compound_stmt_str = """\
Name: <module>
Filename: <disassembly>
Argument count: 0
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 0
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 0
Stack size: \\d+
Flags: 0x0
Expand All @@ -1592,9 +1592,9 @@ async def async_def():
code_info_async_def = """\
Name: async_def
Filename: (.*)
Argument count: 0
Positional-only arguments: 0
Kw-only arguments: 0
Positional parameters: 0
Positional-only parameters: 0
Keyword-only parameters: 0
Number of locals: 2
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS, COROUTINE
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the use of the terms "argument" and "parameter" in
:func:`dis.show_code`.
Loading

Back | FazBrowse Home | New Git URL