[Python-3000] socket GC worries
janssen at parc.com
Mon Oct 29 00:36:42 CET 2007
> Bill Janssen wrote:
> > that whole mess of code is a good argument for *not* exposing the
> > fileno in Python
> Seems to me that a socket should already *be* a file,
> so it shouldn't need a makefile() method and you
> shouldn't have to mess around with filenos.
I like that model, too. I also wish the classes in io.py were sort of
inverted; that is, I'd like to have an IOStream base class with read()
and write() methods (and maybe close()), which things like Socket
could inherit from. FileIO would inherit from IOStream and from
Seekable, and add a fileno() method and "name" property. And so
forth. But apparently that's out; maybe in Python 4000.
Right now the socket is very much like an OS socket; with "send" and
"recv" being the star players, not "read" and "write". socket.makefile
wraps a buffered file-like interface around it.
More information about the Python-3000