Message139374
| Author |
terry.reedy |
| Recipients |
docs@python, terry.reedy |
| Date |
2011年06月28日.19:22:57 |
| SpamBayes Score |
8.667966e-10 |
| Marked as misclassified |
No |
| Message-id |
<1309288978.39.0.732754105333.issue12434@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Trying 3.2 code with 2.7, I got this (greatly simplified):
from __future__ import print_function
from io import StringIO
print('hello world', file=StringIO())
Traceback...
TypeError: string argument expected, got 'str'
(StringIO.StringIO works fine, of course.)
This was initially confusing. Suggestion: after
"Note Since this module has been designed primarily for Python 3.x, you have to be aware that all uses of "bytes" in this document refer to the str type (of which bytes is an alias), and all uses of "text" refer to the unicode type. "
add
'String' in exception messages may also mean the unicode type." |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月28日 19:22:58 | terry.reedy | set | recipients:
+ terry.reedy, docs@python |
| 2011年06月28日 19:22:58 | terry.reedy | set | messageid: <1309288978.39.0.732754105333.issue12434@psf.upfronthosting.co.za> |
| 2011年06月28日 19:22:57 | terry.reedy | link | issue12434 messages |
| 2011年06月28日 19:22:57 | terry.reedy | create |
|