Message206773
If partition is called with a single byte it works correctly but if called with the equivalent integer it returns the same bytearray with two empty arrays as follows.
py> ba = bytearray(range(8))
py> ba
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07')
py> 3 in ba
True
py> ba.find(3) == ba.index(3) == ba.find(b'\x03')
True
py> ba.partition(b'\x03')
(bytearray(b'\x00\x01\x02'), bytearray(b'\x03'), bytearray(b'\x04\x05\x06
\x07'))
py> ba.partition(3)
(bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07'), bytearray(b''), bytearray
(b''))
More background on the thread starting here https://mail.python.org/pipermail/python-list/2013-December/663111.html which refers to Issue 12170. |
|
Date |
User |
Action |
Args |
2013-12-21 19:52:41 | BreamoreBoy | set | recipients:
+ BreamoreBoy |
2013-12-21 19:52:41 | BreamoreBoy | set | messageid: <1387655561.39.0.594856092375.issue20047@psf.upfronthosting.co.za> |
2013-12-21 19:52:41 | BreamoreBoy | link | issue20047 messages |
2013-12-21 19:52:40 | BreamoreBoy | create | |
|