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 [...] What on earth are you trying to do here? There are at least two bugs in this line: (a) long.__add__ is an unbound method so requires two arguments; (b) __setitem__ suggests that you're creating a mutable object; but long is immutable and even if your subclass isn't immutable, it still can't modify the immutable underlying long. You probably want to write a class that *has* a long (I agree that it is a good type to implement a bit array) instead of one that *is* a long. Subclassing is overrated! I don't understand at all what you're saying about decimal. You should take this to comp.lang.python; python-dev is about developing Python, not about programming questions. Even if you believe that your problem can only be solved by changes to Python, I gurantee you that it's much better to discuss this on c.l.py; most likely there's a solution to your problem (once you understand it) that does not involve changing the language or its implementation. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
