forked from rocky/python-uncompyle6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10_lambda.py
More file actions
36 lines (29 loc) · 1 KB
/
10_lambda.py
File metadata and controls
36 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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))()