-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrappers.py
30 lines (24 loc) · 924 Bytes
/
wrappers.py
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
# cuz i am slim shady, the slimmiest of shadies, all you other limidadies are just imitating... idk i am not a wrapper
def bindto(attr, of_class = None, share = False):
def outer(fn):
def inner(*args, **kwargs):
return fn(*args, **kwargs)
inner.bindto = attr
inner.share = share
inner.of_class = of_class
return inner
return outer
def bindfrom(attr, of_class = None, share = False):
def outer(fn):
def inner(*args, **kwargs):
return fn(*args, **kwargs)
inner.bindfrom = attr
inner.share = share
inner.of_class = of_class
return inner
return outer
def nobind(fn):
def inner(*args, **kwargs):
return fn(*args, **kwargs)
inner.nobind = "nobind"
return inner