print bypasses calling write method for objects inheriting from file?

Peter Otten __peter__ at web.de
Wed May 30 03:24:30 EDT 2007


MisterPete wrote:

> I created an object that inherits from file and was a bit surprised to
> find that print seems to bypass the write method for objects
> inheriting from file.  An optimization I suppose.  Does this surprise
> anyone else at all or am I missing something?

No, your analysis is correct, though I'd consider optimization an euphemism
for bug here. Noone was annoyed enough to write a patch, it seems.

Peter






More information about the Python-list mailing list