Message139108
| Author |
terry.reedy |
| Recipients |
r.david.murray, ssbarnea, terry.reedy |
| Date |
2011年06月25日.18:31:39 |
| SpamBayes Score |
1.4869467e-07 |
| Marked as misclassified |
No |
| Message-id |
<1309026699.59.0.537268578618.issue12398@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In 2.7, bytes is an alias for str to aid porting to 3.x.
>>> bytes is str
True
>>> type(bytes())
<type 'str'>
I suspect the doc uses 'bytes' rather than 'str' because it was backported from 3.x. Perhaps it should be changed but I do not know the policy on using the alias in 2.6/7 docs.
I presume in 2.7 io.BytesIO is similar, if not equivalent to io.StringIO, but it is not an alias. Again, it was added so 2.7 code could use a bytes memory buffer that would remain bytes in 3.x and not become unicode text, like StringIO does. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月25日 18:31:39 | terry.reedy | set | recipients:
+ terry.reedy, r.david.murray, ssbarnea |
| 2011年06月25日 18:31:39 | terry.reedy | set | messageid: <1309026699.59.0.537268578618.issue12398@psf.upfronthosting.co.za> |
| 2011年06月25日 18:31:39 | terry.reedy | link | issue12398 messages |
| 2011年06月25日 18:31:39 | terry.reedy | create |
|