Files
python-uncompyle6/test/simple_source/expression/10_lambda.py
rocky 3234673422 mklambda -> lambda_body matches Python AST better
Note: we can't use "lambda" since that is a reserved word
2021-12-26 18:48:51 -05:00

37 lines
1.0 KiB
Python

# Bug in Python 3
# Python 3.3+
# lambda_body ::= LOAD_LAMBDA LOAD_CONST MAKE_FUNCTION_0
# Python 3.0 .. 3.2
# lambda_body ::= LOAD_LAMBDA MAKE_FUNCTION_0
# _lambda_body ::= lambda_body
# expr ::= _lambda_body
# kwarg ::= LOAD_CONST expr
# exprlist ::= exprlist expr
# call_function ::= expr kwarg CALL_FUNCTION_256
import inspect
inspect.formatargvalues(formatvalue=lambda value: __file__)
# bug from python 3.2 calendar
# Handling lambda
months = []
months.insert(0, lambda x: "")
# Python 3.2 configparser.py
class ExtendedInterpolation():
def items(self, section, option, d):
value_getter = lambda option: self._interpolation.before_get(self,
section, option, d[option], d)
return value_getter
# Bug from Python 2.7's test_collections.py
# is that the lambda function has two
# statements in it, one for returning *after* the yield
# The return None statement should be removed and the
# yield should be turned into a statement
def test_Iterable(self):
return (lambda: (yield))()