On 27 August 2010 09:40, Stefan Behnel <[email protected]> wrote:
> 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.
>

I have a patch somewhere, I remember there were a few minor issues about it.


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to