-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path__init__.py
More file actions
38 lines (29 loc) · 1020 Bytes
/
__init__.py
File metadata and controls
38 lines (29 loc) · 1020 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
class WithObjClass:
def __init__(self, suppress, fn_list):
self.suppress = suppress
self.fn_list = fn_list
def __enter__(self):
self.fn_list.append("enter")
def doit_noerr(self):
return 1
def doit_err(self):
raise Exception("Spam", "Eggs")
def __exit__(self, ex_type, ex_val, ex_traceback):
self.fn_list.append("exit: " + str(ex_val))
return self.suppress
def for_iter(arg):
retval = []
for item in arg:
retval.append(item)
return retval
def calling_custom_clojure_fn(arg):
return arg.clojure_fn()
def complex_fn(a, b, c: str=5, *args, d=10, **kwargs):
return {"a" : a,
"b" : b,
"c" : c,
"args" : args,
"d": d,
"kwargs": kwargs}
complex_fn_testcases = {"complex_fn(1, 2, c=10, d=10, e=10)":complex_fn(1, 2, c=10, d=10, e=10),
"complex_fn(1, 2, 10, 11, 12, d=10, e=10)":complex_fn(1, 2, 10, 11, 12, d=10, e=10)}