illegal decorators tests

This commit is contained in:
David Halter
2013-08-09 18:12:51 +04:30
parent dce6f4a232
commit c35da04820

View File

@@ -142,6 +142,29 @@ JustAClass.a.__closure__
#? int()
JustAClass.a()
# -----------------
# illegal decorators
# -----------------
class DecoratorWithoutCall():
def __init__(self, func):
self.func = func
def __call__(self):
return self.func()
@DecoratorWithoutCall
def f():
return 1
@DecoratorWithoutCall(None)
def g():
return 1
#?
f()
#? int()
g()
# -----------------
# method decorators
# -----------------