Johannes Gijsbers | cb9015d | 2004-12-12 16:20:22 +0000 | [diff] [blame] | 1 | # line 1 |
2 | def wrap(foo=None): | ||||
Tim Peters | 5a9fb3c | 2005-01-07 16:01:32 +0000 | [diff] [blame] | 3 | def wrapper(func): |
4 | return func | ||||
5 | return wrapper | ||||
Johannes Gijsbers | cb9015d | 2004-12-12 16:20:22 +0000 | [diff] [blame] | 6 | |
7 | # line 7 | ||||
8 | def replace(func): | ||||
Tim Peters | 5a9fb3c | 2005-01-07 16:01:32 +0000 | [diff] [blame] | 9 | def insteadfunc(): |
10 | print 'hello' | ||||
11 | return insteadfunc | ||||
Johannes Gijsbers | cb9015d | 2004-12-12 16:20:22 +0000 | [diff] [blame] | 12 | |
13 | # line 13 | ||||
14 | @wrap() | ||||
15 | @wrap(wrap) | ||||
16 | def wrapped(): | ||||
Tim Peters | 5a9fb3c | 2005-01-07 16:01:32 +0000 | [diff] [blame] | 17 | pass |
Johannes Gijsbers | cb9015d | 2004-12-12 16:20:22 +0000 | [diff] [blame] | 18 | |
19 | # line 19 | ||||
20 | @replace | ||||
21 | def gone(): | ||||
Tim Peters | 5a9fb3c | 2005-01-07 16:01:32 +0000 | [diff] [blame] | 22 | pass |
Johannes Gijsbers | 1542f34 | 2004-12-12 16:46:28 +0000 | [diff] [blame] | 23 | |
24 | # line 24 | ||||
25 | oll = lambda m: m | ||||
26 | |||||
27 | # line 27 | ||||
28 | tll = lambda g: g and \ | ||||
29 | g and \ | ||||
30 | g | ||||
31 | |||||
32 | # line 32 | ||||
33 | tlli = lambda d: d and \ | ||||
34 | d | ||||
35 | |||||
36 | # line 36 | ||||
37 | def onelinefunc(): pass | ||||
38 | |||||
39 | # line 39 | ||||
40 | def manyargs(arg1, arg2, | ||||
41 | arg3, arg4): pass | ||||
42 | |||||
43 | # line 43 | ||||
44 | def twolinefunc(m): return m and \ | ||||
45 | m | ||||
46 | |||||
47 | # line 47 | ||||
48 | a = [None, | ||||
49 | lambda x: x, | ||||
50 | None] | ||||
51 | |||||
52 | # line 52 | ||||
53 | def setfunc(func): | ||||
54 | globals()["anonymous"] = func | ||||
55 | setfunc(lambda x, y: x*y) | ||||
Johannes Gijsbers | a5855d5 | 2005-03-12 16:37:11 +0000 | [diff] [blame] | 56 | |
57 | # line 57 | ||||
58 | def with_comment(): # hello | ||||
59 | world | ||||
60 | |||||
61 | # line 61 | ||||
62 | multiline_sig = [ | ||||
63 | lambda (x, | ||||
64 | y): x+y, | ||||
65 | None, | ||||
66 | ] |