this is my code:
def a():
print 'sss'
@a()
def b():
print 'aaa'
b()
and the Traceback is:
sss
Traceback (most recent call last):
File "D:\zjm_code\a.py", line 8, in <module>
@a()
TypeError: 'NoneType' object is not callable
so how to use the '@'
thanks
updated
class a:
@property
def b(x):
print 'sss'
aa=a()
print aa.b
it print :
sss
None
how to use @property
thanks
updated2
and the classmethod:
class a:
@classmethod
def b(x):
print 'sss'
aa=a()
print aa.b
the it print :
<bound method classobj.b of <class __main__.a at 0x00B2DC00>>