mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
illegal decorators tests
This commit is contained in:
@@ -142,6 +142,29 @@ JustAClass.a.__closure__
|
|||||||
#? int()
|
#? int()
|
||||||
JustAClass.a()
|
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
|
# method decorators
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user