[Python-Dev] bytes thoughts (original) (raw)
Jason Orendorff jason.orendorff at gmail.com
Wed Mar 1 22:12:24 CET 2006
- Previous message: [Python-Dev] Slightly OT: Replying to posts
- Next message: [Python-Dev] wiki as scratchpad
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- 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().
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.
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
- Previous message: [Python-Dev] Slightly OT: Replying to posts
- Next message: [Python-Dev] wiki as scratchpad
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]