A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/040926.html below:

[Python-Dev] Proposal for new core module: UserFIle

[Python-Dev] Proposal for new core module: UserFIle [Python-Dev] Proposal for new core module: UserFIleGuido van Rossum guido at python.org
Thu Dec 11 19:57:05 EST 2003
> > > rwio = UserFile.MergedIO(sys.stdin, sys.stdout)

> > That's not a motivation.  How does writing rwio.readline() and
> > rw.write() enable your program to do something that wasn't
> > possible by using sys.stdin and sys.stdout directly?
> 
> _MY_ programs could do that, but what if you got some third party
> module that wanted a single read/write file object and you wanted to
> use it on stdio?

> It makes APIs more regular and consistent by requiring only one
> read/write object. For example, the library method could be passed a
> single read/write Unix socket, or a read/write TCP socket, or stdio
> object (MergedIO object).

Well, the standard way of wrapping a file object around a socket
pretty much forces you to have separate read and write objects; check
out the makefile() method. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4