You can use @staticmethod/@classmethod decorators. But IIRC this only
work for normal 'def' methods, not for 'cdef' ones.

2009/5/20 Stéfan van der Walt <[email protected]>:
> Hi all,
>
> I read in the documentation that static methods can be defined as follows:
>
> cdef int MyClass_my_method(int x):
>    return x
>
> cdef class MyClass:
>    my_method = classmethod(MyClass_my_method)
>
> Now, I would like to define the corresponding header:
>
> cdef class MyClass:
>    cdef my_method(int x)
>
> However, when I try to compile I get:
>
> "Self argument of C method does not match parent type."
>
> What is the correct way to address this problem?
>
> Regards
> Stéfan
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to