[New-bugs-announce] [issue20686] Confusing statement
Daniel U. Thibault
report at bugs.python.org
Wed Feb 19 17:24:55 CET 2014
New submission from Daniel U. Thibault:
Near the end of 3.1.3 http://docs.python.org/2/tutorial/introduction.html#unicode-strings you can read:
"When a Unicode string is printed, written to a file, or converted with str(), conversion takes place using this default encoding."
This can be interpreted as stating that stating that printing a Unicode string (using the print function or the shell's default print behaviour) results in ASCII printout. It can likewise be interpreted as stating that any write of a Unicode string to a file converts the string to ASCII. Experimentation shows this is not true. Perhaps you meant something like this:
"When a Unicode string is converted with str() in order to be printed or written to a file, conversion takes place using this default encoding."
Grammatical comments: In the statement "When a Unicode string is printed, written to a file, or converted with str(), conversion takes place using this default encoding.", the ", or" puts the three elements of the enumeration on the same level (respectively "printed", "written to a file", and "converted with str()"). The confusion seems to arise because "with str()" was meant to apply to the list as a whole, not just its last element.
----------
assignee: docs at python
components: Documentation
messages: 211627
nosy: Daniel.U..Thibault, docs at python
priority: normal
severity: normal
status: open
title: Confusing statement
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20686>
_______________________________________
More information about the New-bugs-announce
mailing list