[Cython] nested C++ classes, the third: default constructor

2012-01-19 Thread Simon Anders
Hi, sorry for spreading these issues into three mails, but I cannot quite figure out whether they are related or not. So, here is the third installment of my adventures with nested classes. Consider the following code which compiles fine: ---8<--- cdef extern from "foo": cdef cppclass out

[Cython] non-template nested C++ classes

2012-01-19 Thread Simon Anders
Hi, I'm currently experimenting with Cython's support for nested C++ classes and might havce encountered a bug. I have attempted to strip down the example from the documentation to its bare minimum. This here works fine: ---8<--- cdef extern from "foo": cdef cppclass outer[T]: c

[Cython] Cython crash: C++ class with missing default constructor

2012-01-19 Thread Simon Anders
Hi, the following very short Cython code crashes the Cython compiler (v0.15.1): ---8<--- cdef extern from "foo.h": cdef cppclass foo: pass foo() ---8<--- The stack trace is attached. Best regards Simon Traceback (most recent call last): File "/home/anders/tmp/Cython-0.15.1/cytho

Re: [Cython] Speedup module-level lookup

2012-01-19 Thread Robert Bradshaw
On Thu, Jan 19, 2012 at 12:18 AM, Chris Colbert wrote: > If it doesn't pass PyDict_CheckExact you won't be able to use it as the > globals to eval or exec. :(. I wonder how many other places have similar restrictions, perhaps even implicitly. In particular, this would mean that an eval statement

Re: [Cython] Speedup module-level lookup

2012-01-19 Thread Chris Colbert
If it doesn't pass PyDict_CheckExact you won't be able to use it as the globals to eval or exec. That's assuming you hack the module type so you can change its __dict__. On Jan 19, 2012 2:01 AM, "Robert Bradshaw" wrote: > On Wed, Jan 18, 2012 at 11:53 PM, Vitja Makarov > wrote: > > 2012/1/19 Vit

Re: [Cython] Speedup module-level lookup

2012-01-19 Thread mark florisson
On 19 January 2012 08:00, Robert Bradshaw wrote: > On Wed, Jan 18, 2012 at 11:53 PM, Vitja Makarov > wrote: >> 2012/1/19 Vitja Makarov : >>> 2012/1/19 Robert Bradshaw : I think the right thing to do here is make all module-level globals into "cdef public" attributes, i.e. C globals wit

Re: [Cython] Speedup module-level lookup

2012-01-19 Thread Robert Bradshaw
On Wed, Jan 18, 2012 at 11:53 PM, Vitja Makarov wrote: > 2012/1/19 Vitja Makarov : >> 2012/1/19 Robert Bradshaw : >>> I think the right thing to do here is make all module-level globals >>> into "cdef public" attributes, i.e. C globals with getters and setters >>> for Python space. I'm not sure wh