Two small clarifications after comments by Detlef Lannart.
This commit is contained in:
parent
cdb77a562c
commit
1423939929
|
@ -40,7 +40,9 @@ Specification
|
|||
In a Python with universal newline support open() the mode
|
||||
parameter can also be "t", meaning "open for input as a text file
|
||||
with universal newline interpretation". Mode "t" cannot be
|
||||
combined with other mode flags such as "+".
|
||||
combined with other mode flags such as "+". Any line ending in the
|
||||
input file will be seen as a '\n' in Python, so little other code has
|
||||
to change to handle universal newlines.
|
||||
|
||||
There is no special support for output to file with a different
|
||||
newline convention.
|
||||
|
@ -77,7 +79,8 @@ Rationale
|
|||
programs are expected to handle this by themselves or write files
|
||||
with platform-local convention otherwise. The reason for this is
|
||||
that input is the difficult case, outputting different newlines to
|
||||
a file is already easy enough in Python.
|
||||
a file is already easy enough in Python. It would also slow down
|
||||
all "normal" Python output, even if only a little.
|
||||
|
||||
While universal newlines are automatically enabled for import they
|
||||
are not for opening, where you have to specifically say open(...,
|
||||
|
|
Loading…
Reference in New Issue