[Python-checkins] r57185 - peps/trunk/pep-3116.txt
guido.van.rossum
python-checkins at python.org
Sat Aug 18 23:17:04 CEST 2007
Author: guido.van.rossum
Date: Sat Aug 18 23:17:04 2007
New Revision: 57185
Modified:
peps/trunk/pep-3116.txt
Log:
Change when lines are translated on input (only if newline=None),
and clarify language around translation.
Also remark that SocketIO lives in the socket module, and drop
reference to MemIO.
Modified: peps/trunk/pep-3116.txt
==============================================================================
--- peps/trunk/pep-3116.txt (original)
+++ peps/trunk/pep-3116.txt Sat Aug 18 23:17:04 2007
@@ -131,10 +131,10 @@
Returns the underlying file descriptor (an integer)
Initially, three implementations will be provided that implement the
-``RawIOBase`` interface: ``FileIO``, ``SocketIO``, and ``ByteIO``
-(also ``MMapIO``?). Each implementation must determine whether the
-object supports random access as the information provided by the user
-may not be sufficient (consider ``open("/dev/tty", "rw")`` or
+``RawIOBase`` interface: ``FileIO``, ``SocketIO`` (in the socket
+module), and ``ByteIO``. Each implementation must determine whether
+the object supports random access as the information provided by the
+user may not be sufficient (consider ``open("/dev/tty", "rw")`` or
``open("/tmp/named-pipe", "rw")``). As an example, ``FileIO`` can
determine this by calling the ``seek()`` system call; if it returns an
error, the object does not support random access. Each implementation
@@ -361,14 +361,17 @@
are returned to the caller untranslated. If it has any of
the other legal values, input lines are only terminated by
the given string, and the line ending is returned to the
- caller translated to ``'\n'``.
+ caller untranslated. (In other words, translation to
+ ``'\n'`` only occurs if ``newline`` is ``None``.)
* On output, if ``newline`` is ``None``, any ``'\n'``
characters written are translated to the system default
line separator, ``os.linesep``. If ``newline`` is ``''``,
no translation takes place. If ``newline`` is any of the
other legal values, any ``'\n'`` characters written are
- translated to the given string.
+ translated to the given string. (Note that the rules
+ guiding translation are different for output than for
+ input.)
Further notes on the ``newline`` parameter:
More information about the Python-checkins
mailing list