On 7/22/06, Sebastian Haase <[EMAIL PROTECTED]> wrote:
Normally I could do
class B(N.ndarray):
a.__class__ = B

BUT I get this error:
#>>> a.__class__ = B
Traceback (most recent call last):
   File "<input>", line 1, in ?
TypeError: __class__ assignment: only for heap types

What is a "heap type" ? Why ?  How can I do what I want ?

Assigning to __class__ makes sense for objects that allocate a dictionary for storage of attributes or have slots allocated to hold the values.  The heap type error is due to a missing flag in the class definition and could be corrected.  However, it may not be the best thing to do.  Calling B(array) is certainly safer, although a bit more expensive.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Numpy-discussion mailing list

Reply via email to