can't set attributes of built-in/extension type

Neal Becker ndbecker2 at gmail.com
Thu Feb 21 13:19:21 EST 2008


I'm working on a simple extension.  Following the classic 'noddy' example.

In [15]: cmplx_int32
Out[15]: <type 'numpy.cmplx_int32'>

Now I want to add an attribute to this type.  More precisely, I want a class
attribute.

cmplx_int32.test = 0
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/nbecker/numpy/<ipython console> in <module>()

TypeError: can't set attributes of built-in/extension
type 'numpy.cmplx_int32'

What am I missing?




More information about the Python-list mailing list