Dennis Heuer [EMAIL PROTECTED] wrote:
OK, let's get back to the bitarray type. To first be clear about the
*type* of bitarray: The type I talk about is really a *bit*-array and
not a *bytewise*-array, as most developers seem to think of it. The
array doesn't provide the boolean manipulation
The real misunderstanding lies somewhere else. I thought that the
bitarray's instance would have more control over the long type's
instance, like with the mutable types. I thought that the long type's
superclass would provide methods similar to __setitem__ that would
allow the bitarray instance to
Dennis Heuer wrote:
The real misunderstanding lies somewhere else. I thought that the
bitarray's instance would have more control over the long type's
instance, like with the mutable types. I thought that the long type's
superclass would provide methods similar to __setitem__ that would
allow
Have never seen such an answer before. Please excuse if I read it
wrong. The method would just return the new values, for shure. That is
what it shall do. The interpreter calls that method for receiving the
new (to be used) values to pass them on to the real target (the called
attribute). The
To bring the real problem more upfront. Up to now, inheriting classes
is all about processing (the output channel) but not about retrieving
(the input channel). However, though a new type can advance from an
existing type if it just needs to provide some few more methods, it can
not advance from
I doubt you'll get many answers. I have no idea what you're talking
about. How about an example or two?
On 4/26/06, Dennis Heuer [EMAIL PROTECTED] wrote:
To bring the real problem more upfront. Up to now, inheriting classes
is all about processing (the output channel) but not about retrieving
OK, let's get back to the bitarray type. To first be clear about the
*type* of bitarray: The type I talk about is really a *bit*-array and
not a *bytewise*-array, as most developers seem to think of it. The
array doesn't provide the boolean manipulation of single bytes in the
array, it provides
I still don't understand what you are asking for. However there's one
problem with your code:
On 4/26/06, Dennis Heuer [EMAIL PROTECTED] wrote:
class bitarray(long):
...
def __setitem__(self, key, value):
[...]
long.__add__(2**key * value) # Should actually overwrite the
Dennis Heuer wrote:
The reason why I'd like to use the long type as the base of my bitarray
type is that the long type is already implemented as an array and
working efficiently with large amounts of bytes.
This is wrong; you are mixing up the is-a and has-a relationships.
While it might be