1 Feb 08:02
Re: Re: passing pointers into __init__
Stefan Behnel <stefan_ml <at> behnel.de>
2012-02-01 07:02:24 GMT
2012-02-01 07:02:24 GMT
mark florisson, 31.01.2012 21:55: > On 31 January 2012 20:28, Thomas wrote: >> Yes, that compiled. Thank you. >> >> Why did that work? Is cdef required when defining any variables that >> are cdef class types? > > It's not required, but then Cython treats it as an arbitrary Python > object as it doesn't know what it is. Turning on type inferencing > would probably make it work as well. Hmm, I had thought that we got this to work - at least, it should work because the return type of the fast instantiation call is always known, so the object type can be inferred. My guess is that it's an issue with the execution order of type inference and this specific optimisation. Basically, the step that could infer the type of the variable as an extension type can't know that it will have that type because the call to __new__() wasn't analysed yet. Once again, the anticipated type analysis restructuring would fix this. Stefan
RSS Feed