[Pyrex] array/list of extension type

Stefan Behnel stefan_ml at behnel.de
Tue Nov 20 16:02:03 CET 2007


Tomas Sirny wrote:
> Defining matrix as object works, but everytime I want to call method of
> Neuron as matrix[i], I must explicitly cast it with <Neuron>. So, how
> can I make it c array? To be concrete, how to define it? All methods of
> Neuron are c functions(cdef ...).

You can do this:

	cdef Neuron neuron
	neuron = matrix[i]
	neuron.doSomething()

Stefan



More information about the Pyrex mailing list