Message179545
The PEP 3132 said:
"""
... if seq is a slicable sequence, all the following assignments are equivalent if seq has at least three elements:
a, b, c = seq[0], seq[1:-1], seq[-1]
a, *b, c = seq
[a, *b, c] = seq
"""
But this doesn't happen for byte strings:
>>> seq = b'xyz'
>>> a, b, c = seq[0], seq[1:-1], seq[-1]
>>> a, b, c
(120, b'y', 122)
>>> a, *b, c = seq
>>> a, b, c
(120, [121], 122)
Tested on Python3.3 and Python3.2 (Linux Ubuntu 11.04) |
|
Date |
User |
Action |
Args |
2013-01-10 14:08:15 | marco.buttu | set | recipients:
+ marco.buttu |
2013-01-10 14:08:15 | marco.buttu | set | messageid: <1357826895.67.0.646270991721.issue16916@psf.upfronthosting.co.za> |
2013-01-10 14:08:15 | marco.buttu | link | issue16916 messages |
2013-01-10 14:08:14 | marco.buttu | create | |
|