• Jeremy Hylton's avatar
    the previous quick hack to fix def foo((x,y)) failed on some cases · 3ec7e2c4
    Jeremy Hylton yazdı
    (big surprise).  new solution is a little less hackish.
    
    Code gen adds a TupleArg instance in the argument slot. The tuple arg
    includes a copy of the names that it is responsble for binding.  The
    PyAssembler uses this information to calculate the correct argcount.
    
    all fix this wacky case: del (a, ((b,), c)), d
    which is the same as: del a, b, c, d
    (Can't wait for Guido to tell me why.)
    
    solution uses findOp which walks a tree to find out whether it
    contains OP_ASSIGN or OP_DELETE or ...
    3ec7e2c4
pycodegen.py 29 KB