> > > 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/)
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