[Python-Dev] Re: adding a bytes sequence type to Python
rnd at onego.ru
Wed Aug 18 06:30:58 CEST 2004
On Tue, 17 Aug 2004, M.-A. Lemburg wrote:
>Roman Suzi wrote:
>> On Tue, 17 Aug 2004, M.-A. Lemburg wrote:
>> It was in the shadows because we had byte-strings.
>Right, so why not revive it ?!
>Anyway, this whole discussion about a new bytes type doesn't
>really solve the problem that the b'...' literal was
>intended for: that of having a nice way to define (read-only)
>8-bit binary string literals.
I think new _mutable_ bytes() type is better than old 8-bit binary strings
for binary data processing purposes.
Or do we need them for legacy text-procesing software?
>We already have a number of read-write types for storing binary
>data, e.g. arrays, cStringIO and buffers. Inventing yet another
>way to spell binary data won't make life easier.
>However, what will be missing is a nice way to spell read-only
>Since 'tada' will return a Unicode object in Py3k, I think we
>should reuse the existing 8-bit string object under the new
>literal constructor b'tada\x00' (and apply the same source code
>encoding semantics we apply today for 'tada\x00').
Sincerely yours, Roman Suzi
rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3
More information about the Python-Dev