[Python-Dev] [Python-ideas] PEP 3156 - Asynchronous IO Support Rebooted

Nick Coghlan ncoghlan at gmail.com
Wed Jan 9 12:06:45 CET 2013


On Wed, Jan 9, 2013 at 8:55 PM, Yuriy Taraday <yorik.sar at gmail.com> wrote:
> My interns told me that they remember EOF as special object only from high
> school when they had to study Pascal. I guess, in 5 years students won't
> understand how one can write an EOF. (and schools will finally replace
> Pascal with Python)

Python really doesn't try to avoid the concept of an End-of-file marker.

================
$ python3
Python 3.2.3 (default, Jun  8 2012, 05:36:09)
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> import io
>>> print(io.FileIO.read.__doc__)
read(size: int) -> bytes.  read at most size bytes, returned as bytes.

Only makes one system call, so less data may be returned than requested
In non-blocking mode, returns None if no data is available.
On end-of-file, returns ''.
================

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list