simple example of calling a class

class myKlass(object):

    def __call__(self, *args, **kws):
         print "i was called"


>> test = myKlass()

>> test()

>> i was called


>
>
>
> On Wed, Jul 15, 2009 at 6:33 AM, Kent Johnson <ken...@tds.net> wrote:
>
>> On Wed, Jul 15, 2009 at 7:41 AM, Todd Matsumoto<tmatsum...@gmx.net>
>> wrote:
>> > Hi,
>> >
>> > Can some one give, or point to some good examples of how @decorators
>> work, and __call__ (able) objects?
>>
>> Decorators:
>> http://personalpages.tds.net/~kent37/kk/00001.html<http://personalpages.tds.net/%7Ekent37/kk/00001.html>
>>
>> Kent
>> _______________________________________________
>> Tutor maillist  -  Tutor@python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to