Extend file type

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Tue Sep 26 11:35:07 EDT 2006


abcd enlightened us with:
> Any suggestions on how to find out?  I did try adding to MyFile....
>
> def __call__(self, *args):
>     print "calling:", args
>     return file.__call__(self, *args)
>
> but I never see that either.

I don't know the answer to your problem, but I can explain why this
doesn't work. __call__ is used when an instance if MyFile is called as
if it were a function:

    mf = MyFile("blabla")
    mf()

Sybren
-- 
Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/



More information about the Python-list mailing list