This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BreamoreBoy
Recipients BreamoreBoy
Date 2013-12-21.19:52:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387655561.39.0.594856092375.issue20047@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-12-21 19:52:41BreamoreBoysetrecipients: + BreamoreBoy
2013-12-21 19:52:41BreamoreBoysetmessageid: <1387655561.39.0.594856092375.issue20047@psf.upfronthosting.co.za>
2013-12-21 19:52:41BreamoreBoylinkissue20047 messages
2013-12-21 19:52:40BreamoreBoycreate