Re: [Cython] Bug: bad C code generated for (some) "... and ... or ..." expressions

2012-06-07 Thread Stefan Behnel
Hi, thanks for the report. Dieter Maurer, 07.06.2012 10:44: > "cython 0.13" generates bad C code for the attached "pyx" file. Could you try the latest release? I would at least expect an error instead of actually generating code. > "cython" itself recognizes that it did something wrong and emi

Re: [Cython] Why does "__cinit__" insists on converting its arguments to Python objects?

2012-06-07 Thread Robert Bradshaw
Both __init__ and __cinit__ are passed the same arguments, and the former has Python calling conventions. (Also, we use Python's framework to allocate and construct the new object, so there's not a huge amount of flexibility here and working around this would be quite non-trivial). On Thu, Jun 7,

Re: [Cython] Hash-based vtables

2012-06-07 Thread Dag Sverre Seljebotn
On 06/07/2012 12:20 PM, Dag Sverre Seljebotn wrote: On 06/07/2012 12:26 AM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 2:36 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 11:16 PM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 1:57 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 10:41 PM,

[Cython] Why does "__cinit__" insists on converting its arguments to Python objects?

2012-06-07 Thread Dieter Maurer
The following cython source leads to a "Cannot convert 'pointer' to Python object". ctypedef void * pointer cdef extern from "nonexistant.h": cdef pointer to_pointer(object) cdef class C: cdef pointer p def __cinit__(self, pointer p): self.p = p c = C(to_pointer(None)) Why does the con

Re: [Cython] Hash-based vtables

2012-06-07 Thread Dag Sverre Seljebotn
On 06/07/2012 12:45 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 11:00 PM, Robert Bradshaw wrote: On Tue, Jun 5, 2012 at 2:41 PM, Dag Sverre Seljebotn wrote: Is the goal then to avoid having to have an interning registry? Yes, and to avoid invoking an expensive hash function at runtime in o

Re: [Cython] Hash-based vtables

2012-06-07 Thread Dag Sverre Seljebotn
On 06/06/2012 11:00 PM, Robert Bradshaw wrote: On Tue, Jun 5, 2012 at 2:41 PM, Dag Sverre Seljebotn wrote: Is the goal then to avoid having to have an interning registry? Yes, and to avoid invoking an expensive hash function at runtime in order to achieve good distribution. I don't underst

Re: [Cython] Hash-based vtables

2012-06-07 Thread Dag Sverre Seljebotn
On 06/07/2012 12:20 PM, Dag Sverre Seljebotn wrote: On 06/07/2012 12:26 AM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 2:36 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 11:16 PM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 1:57 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 10:41 PM,

Re: [Cython] Hash-based vtables

2012-06-07 Thread Dag Sverre Seljebotn
On 06/07/2012 12:26 AM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 2:36 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 11:16 PM, Robert Bradshaw wrote: On Wed, Jun 6, 2012 at 1:57 PM, Dag Sverre Seljebotn wrote: On 06/06/2012 10:41 PM, Dag Sverre Seljebotn wrote: On 06/05/2012 12:

[Cython] Bug: bad C code generated for (some) "... and ... or ..." expressions

2012-06-07 Thread Dieter Maurer
"cython 0.13" generates bad C code for the attached "pyx" file. "cython" itself recognizes that it did something wrong and emits ";" to the generated file: ... static __pyx_t_12cybug_and_or_pointer __pyx_f_12cybug_and_or_bug(PyObject *__pyx_v_o) { __pyx_t_12cybug_and_or_pointer __pyx_r; int