mirror of
https://github.com/bendtherules/pyFun.git
synced 2026-08-18 13:52:46 +00:00
summer update
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import inspect
|
||||
|
||||
def original_decorator(func):
|
||||
# need to access class here
|
||||
# for eg, to append the func itself to class variable "a", to register itself
|
||||
# or say, append their default arg values to class variable "a"
|
||||
return func
|
||||
|
||||
class A(object):
|
||||
a=[]
|
||||
|
||||
@classmethod
|
||||
@original_decorator
|
||||
def some_method(self,a=5):
|
||||
''' hello'''
|
||||
print "Calling some_method"
|
||||
@original_decorator
|
||||
def some_method_2(self):
|
||||
''' hello again'''
|
||||
print "Calling some_method_2"
|
||||
|
||||
##print("A.a is %s"%A.a)
|
||||
##print(inspect.getargspec(A.some_method))
|
||||
Reference in New Issue
Block a user