David McNab wrote:

> Thanks, Greg. That is indeed a valid workaround. However, it loses the
> performance benefits of declaring the class as a Pyrex/Cython 'cdef
> class'.

Not all of them -- access to C attributes and C methods
will still be just as fast.

Also, if you declare the Python subclass with __slots__,
no __dict__ will be allocated for it. If you also don't
give it any Python methods, I would expect the performance
difference from a plain extension class to be negligible
for most things.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to