On Wed, Jan 9, 2013 at 8:55 PM, Yuriy Taraday <yorik....@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 | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com