calling a cdef in a cdef class

Posted by Davoud Taghawi-Nejad on Stack Overflow See other posts from Stack Overflow or by Davoud Taghawi-Nejad
Published on 2010-03-14T22:16:44Z Indexed on 2010/03/14 22:25 UTC
Read the original article Hit count: 106

Filed under:

Hello,

is their any way to make this work, without sacrificing the cdef in cdef caller? (no use of cpdef either)

from array import *
from numpy import *
cdef class Agents:
    cdef public caller(self):
        print "caller"
        A[2].called()

    cdef called(self):
        print "called"


A = [Agents() for i in range(2)]

def main():
    A[1].caller()

© Stack Overflow or respective owner

Related posts about cython