[Python-bugs-list] [ python-Feature Requests-501831 ] Bit support in "array" module

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Mar 2002 19:45:03 -0800


Feature Requests item #501831, was opened at 2002-01-10 09:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=501831&group_id=5470

Category: Python Library
Group: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Jesús Cea Avión (jcea)
Assigned to: Guido van Rossum (gvanrossum)
>Summary: Bit support in "array" module

Initial Comment:
I think the standard "array" module should support 
single bit arrays.

In fact, would be very nice a supplementary addition 
to support arbitrary bit size arrays (for example, 5 
bit elements). Of course, single bit should be 
optimiced, since bitmaps management is a frequent task.


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-22 22:45

Message:
Logged In: YES 
user_id=6380

While bit arrays would indeed be nice, the array module's
internal design makes it impractical to add it there. For
small-to-medium size bitmasks, I recommend using long ints
(x<<i is a bitmask for bit i, use & and | and ~ to set and
clear bits). If someone wants to implement a fast bitmap
type in C, let them submit an extension to the patch
manager. Closing this request as "won't fix".

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=501831&group_id=5470