[issue15958] bytes.join() should allow arbitrary buffer objects

Stefan Krah report at bugs.python.org
Sat Sep 22 11:35:33 CEST 2012


Stefan Krah added the comment:

We would need to release the buffers and also check for format 'B'.
With issue15958-2.diff this is possible:

>>> import array
>>> a = array.array('d', [1.2345])
>>> b''.join([b'ABC', a])
b'ABC\x8d\x97n\x12\x83\xc0\xf3?'


It is unfortunate that a PyBUF_SIMPLE request does not guarantee 'B'.
I think that's probably a mistake, but it's certainly existing practice.

----------
nosy: +skrah

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15958>
_______________________________________


More information about the Python-bugs-list mailing list