Oxymoron wrote:
I'm trying to intercept one or more methods in file-like objects
Shadowing perhaps? >>> class open(open): ... def mything(self): ... print "it's my thing" ... >>> a = open(r'c:\testfile','wb') >>> a.mything() it's my thing >>> a.write("this is a test") >>> a.flush() >>> a.close() >>> open(r'c:\testfile','r').read() 'this is a test' >>> Emile _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor