summaryrefslogtreecommitdiff
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-03-28 23:49:17 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2000-03-28 23:49:17 +0000
commit50e36b7e81ffe32ee6c68344dae11f52d214b10c (patch)
tree6341806705e37e6b59c18b50645fb6dfb048d46d /Lib/dis.py
parentdb447ec6d958fadc1ee4ec22acd303084bca6b3a (diff)
downloadcpython-50e36b7e81ffe32ee6c68344dae11f52d214b10c.tar.gz
slightly modified version of Greg Ewing's extended call syntax patch
executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index 4c6764209c..899393d3ac 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -247,10 +247,14 @@ haslocal.append(126)
def_op('SET_LINENO', 127) # Current line number
SET_LINENO = 127
-def_op('RAISE_VARARGS', 130)
-def_op('CALL_FUNCTION', 131)
-def_op('MAKE_FUNCTION', 132)
-def_op('BUILD_SLICE', 133)
+def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
+def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8)
+def_op('MAKE_FUNCTION', 132) # Number of args with default values
+def_op('BUILD_SLICE', 133) # Number of items
+
+def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8)
+def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8)
+def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8)
def _test():