--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cython-users/70532002-4196-4c26-952b-0580f7fbc869n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cython-users/c7a88fe9-e3c0-4c2f-b026-fb178c684912n%40googlegroups.com.
Hi,thanks, but I think this does not fit to my initial code.
You are assuming, that the self.classes list contains instances of the MyClass class. But it contains the class MyClass and a the derived class MyIneritedClass, not instances of them.
So cdef MyClass class_ is not working.
That should work. What's the specific problem?
Ah sorry - I misread what you said.
I'm not sure that what you're trying to is possible I'm afraid.
This is a case where you're trying to do something both very
dynamically (as if you were using Python) but also taking
advantage of Cython's compile-time static typing. Unfortunately
this kind of code typically just doesn't work because it's trying
to mix two incompatible things, and you have to accept the "yellow
highlighting".
Not sure if this is the source of the confusion but cdef classes aren't like Python classes. The fields you declared (e.g. self.classes) are instance attributes.-- PG
To view this discussion visit https://groups.google.com/d/msgid/cython-users/49b11b3d-6949-4c7c-86fb-cc3736b78e72n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cython-users/49b11b3d-6949-4c7c-86fb-cc3736b78e72n%40googlegroups.com.
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cython-users/16ae72f7-3874-4d40-8169-c66fd1eeb5a5n%40googlegroups.com.