Cython uses the Python library to create classes, it will never be
pure C. (But it still can be very fast).
> First question:
> To static type the members (like self.scale) I need to transform the
> class Scale into cdef class Scale,
> and class Interface to cdef class Interface ?
Yes, that could help a lot.
> Second question:
> How can I declare a staticmethod in the cdef class Interface? (If a
> try i get an error "Cdef functions/classes cannot take arbitrary
> decorators.")
>
> I would be glad if someone could outline howto correctly transform the
> above python example into fast cython code.
Though it's not as clean, a quick way to do it would be to pull the
static members and methods out to cdef'd module-level members and
methods. (Fast support for static class members and methods is
something we'd like to have, but it's not there yet.)
- Robert