[Python-3000] New io system and binary data (original) (raw)

Guido van Rossum guido at python.org
Thu Sep 20 04:13:15 CEST 2007


Yeah, the PEP is pretty out of date (perhaps only surpassed by PEP 3135, super()). It's on my list to update it. This should definitely be added.

On 9/19/07, Terry Reedy <tjreedy at udel.edu> wrote:

"Guido van Rossum" <guido at python.org> wrote in message news:ca471dc20709191019k2f5e16e5j75767b25ddf90e30 at mail.gmail.com... | Changing the mode between text and binary is not feasible (since it | would have to change the class). But it is perfectly acceptable to use | sys.std{in,out}.buffer if you need to write a binary transparent | filter. In PEP 3116, the Buffered I/O section has Additionally, the abstract base class provides one member variable: .raw A reference to the underlying RawIOBase object. The Text I/O section does not have, but I presume should, similar lines about member variable .buffer. Perhaps a note could be added that stdin/out will be Text I/O and that the bytes buffer is easily unwrapped via .buffer (and even via .raw). While I sympathize with the initial surprise, I am willing to type .buffer should I need to. The real problem is that 2to3.py cannot do so automatically (and be always. and probably not even usually, correct). tjr


Python-3000 mailing list Python-3000 at python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org

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



More information about the Python-3000 mailing list