forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.py
More file actions
57 lines (38 loc) · 652 Bytes
/
function.py
File metadata and controls
57 lines (38 loc) · 652 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def foo():
"""test"""
return 42
assert foo() == 42
assert foo.__doc__ == "test"
def my_func(a,):
return a+2
assert my_func(2) == 4
def fubar():
return 42,
assert fubar() == (42,)
def f1():
"""test1"""
pass
assert f1.__doc__ == "test1"
def f2():
'''test2'''
pass
assert f2.__doc__ == "test2"
def f3():
"""
test3
"""
pass
assert f3.__doc__ == "\n test3\n "
def f4():
"test4"
pass
assert f4.__doc__ == "test4"
def revdocstr(f):
d = f.__doc__
d = d + 'w00t'
f.__doc__ = d
return f
@revdocstr
def f5():
"""abc"""
assert f5.__doc__ == 'abcw00t', f5.__doc__