Binary list class, strings or longs?

vague msandin at remove_this.hotmail.com
Tue Jan 16 15:51:34 EST 2001


Hi,

Is there anyone who knows if there's a class somewhere that lets me handle
binary objects/streams in Python in a simple way? One possible
implementation would be to have it wrap the string type. I'd like to be able
to perform binary arithmetics on arbitary parts of the objects (as in not
only on byte boundaries or on byte lengths). I would have use for it for
image manipulation in combining bitmasks.

Even more preferable would be if there's a simple way of doing such things
included with Python. It wouldn't be _too_ hard to do such things by
wrapping some string manipulation and the included binary operators in a
class. But I'd rather not if it's possible to avoid or someone else already
did the hairy work for me :-)

Another possiblity would be to use long's as those would make the binary
operations easy, but I don't really know what kind of overhead would be
involved in doing so. Anyone who can tell me?

-
Martin Sandin
http://come.to/vague/





More information about the Python-list mailing list