You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
3.6+ lambda parameter handling
This commit is contained in:
BIN
test/bytecode_3.6_run/02_pos_args.pyc
Normal file
BIN
test/bytecode_3.6_run/02_pos_args.pyc
Normal file
Binary file not shown.
@@ -1,6 +1,12 @@
|
|||||||
# From Python 3.3.6 hmac.py
|
# From Python 3.3.6 hmac.py
|
||||||
# Problem was getting wrong placement of positional args
|
# Problem was getting wrong placement of positional args.
|
||||||
|
# In 3.6+ paramter handling changes
|
||||||
|
|
||||||
|
# RUNNABLE!
|
||||||
|
|
||||||
digest_cons = lambda d=b'': 5
|
digest_cons = lambda d=b'': 5
|
||||||
|
|
||||||
# Handle single kwarg
|
# Handle single kwarg
|
||||||
lambda *, d=0: None
|
x = lambda *, d=0: d
|
||||||
|
assert x(d=1) == 1
|
||||||
|
assert x() == 0
|
||||||
|
@@ -953,11 +953,17 @@ class Python3Parser(PythonParser):
|
|||||||
opname))
|
opname))
|
||||||
self.add_unique_rule(rule, opname, token.attr, customize)
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
|
|
||||||
|
else:
|
||||||
|
rule = ('mklambda ::= %sLOAD_LAMBDA LOAD_CONST %s' %
|
||||||
|
(('expr ' * stack_count), opname))
|
||||||
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
|
|
||||||
|
|
||||||
rule = ('mkfunc ::= %s%s%s%s' %
|
rule = ('mkfunc ::= %s%s%s%s' %
|
||||||
('expr ' * stack_count,
|
('expr ' * stack_count,
|
||||||
'load_closure ' * closure,
|
'load_closure ' * closure,
|
||||||
'LOAD_CONST ' * 2,
|
'LOAD_CONST ' * 2,
|
||||||
opname))
|
opname))
|
||||||
self.add_unique_rule(rule, opname, token.attr, customize)
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
|
|
||||||
if has_get_iter_call_function1:
|
if has_get_iter_call_function1:
|
||||||
|
Reference in New Issue
Block a user