On 1/8/2014 2:56 PM, axis.of.wea...@gmail.com wrote:
can someone please explain why the following works, in contrast to the second
example?
Because function attributes of classes become instance methods, with
special behavior, when accessed via an instance of the class.
def decorator(func)
On 08/01/2014 19:56, axis.of.wea...@gmail.com wrote:
can someone please explain why the following works, in contrast to the second
example?
def decorator(func):
def on_call(*args):
print args
return func(args)
return on_call
class Foo:
@decorator
def bar(s
can someone please explain why the following works, in contrast to the second
example?
def decorator(func):
def on_call(*args):
print args
return func(args)
return on_call
class Foo:
@decorator
def bar(self, param1):
print 'inside bar'
f=Foo()
f.bar(4)