[Python-Dev] bytes thoughts
Jason Orendorff
jason.orendorff at gmail.com
Wed Mar 1 22:12:24 CET 2006
1. Maybe there should be a more obvious way to spell "bytes([0])*N".
I went through "bytes([0]*N)" and "bytes('\0'*N)" before I realized
there was a memory-efficient way to do it.
1a. Likewise, slice-assignment nicely handles memmove(), but there's
no memset().
2. Having a plural noun as a type name is awkward. I wish we could
call it "buffer" (which, conveniently, also tells you that it's
mutable, even if you don't know the word "mutable" :-). Alas.
3. I wrote a toy BytesIO class to go with the toy bytes object:
http://wiki.python.org/moin/BytesIO
(I hope this isn't considered wiki abuse -- it seemed as worthy and
relevant as most of what's in there.)
-j
More information about the Python-Dev
mailing list