ANN: experimental patch to allow importing from file-like objects

Magnus Lie Hetland mlh at vier.idi.ntnu.no
Mon Mar 4 12:05:44 EST 2002


In article <3C817D5C.24C26C3F at earthlink.net>, Hans Nowak wrote:
>Gerson Kurz wrote:
>
[...]
>I don't know much about 2.2 yet, but I think the
>preferred method is subclassing file, then opening a
>file through the subclass's constructor (rather than
>through open()). For example:

open *is* file. (Just take a closer look.)

So you should subclass file (i.e. open) -- and of course you'd then
use the constructor of that class, not the constructor of your
superclass (which would be file or open, which are one and the same).

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org



More information about the Python-list mailing list