[Python-checkins] CVS: python/dist/src/Lib dis.py,1.19,1.20

Jeremy Hylton python-dev@python.org
Tue, 28 Mar 2000 18:49:10 -0500


Update of /projects/cvsroot/python/dist/src/Lib
In directory goon.cnri.reston.va.us:/home/jhylton/python/src/Lib

Modified Files:
	dis.py 
Log Message:
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


Index: dis.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/dis.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** dis.py	2000/02/04 17:47:55	1.19
--- dis.py	2000/03/28 23:49:07	1.20
***************
*** 248,255 ****
  SET_LINENO = 127
  
! def_op('RAISE_VARARGS', 130)
! def_op('CALL_FUNCTION', 131)
! def_op('MAKE_FUNCTION', 132)
! def_op('BUILD_SLICE', 133)
  
  
--- 248,259 ----
  SET_LINENO = 127
  
! 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)