Neal Becker, 27.08.2010 13:32:
> I've noticed that cython extension classes are more restrictive than
> boost::python classes. In particular, I believe boost::python allows
> attributes to be added by python code to boost::python classes, while cython
> classes are 'closed'. Is this correct?
I don't know what kind of classes boost uses, but the above only applies to
extension types in Cython. Normal Python classes behave as in normal
Python. And it should be possible to add a __dict__ to extension types
without much hassle, it's just that most people don't want that.
Initialising a dict takes time during type instantiation and takes
additional space during the lifetime of the object.
BTW, now that you mention it - does anyone know what became of the idea to
allow a
cdef __dict__
attribute notation (as for __weakref__) to add a dict to an extension type?
AFAIR, that was already proposed more than once on this list.
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev