Hi,
Lisandro Dalcin wrote:
> Could someone in this list try to test some simple pyx file with a
> 'cdef class' defining some standard methods and a some 'classmethod'
> and confirm me iff this works or not??
I'm not sure Pyrex/Cython ever supported class methods, but the following
works for me, also in Py2.6.
Stefan
__doc__ = u"""
>>> class1.plus1(1)
2
>>> class2.plus1(1)
2
>>> class3.plus1(1)
2
"""
def f_plus(a):
return a + 1
class class1:
plus1 = f_plus
class class2(object):
plus1 = f_plus
cdef class class3:
plus1 = f_plus
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev