Re: [Cython] [cython-users] which __new__ to use?

2014-01-10 Thread Stefan Behnel
Nils Bruin, 11.01.2014 00:38: > In Objects/typeobject.c:2895 I find: > > static PyObject * > object_new(PyTypeObject *type, PyObject *args, PyObject *kwds) > { > int err = 0; > if (excess_args(args, kwds)) { > if (type->tp_new != object_new && > type->tp_init != object_

Re: [Cython] [cython-users] which __new__ to use?

2014-01-10 Thread Stefan Behnel
[this should have gone to cython-devel - I *hate* those auto-reply-to headers...] Nils Bruin, 10.01.2014 18:55: > On Friday, January 10, 2014 8:42:15 AM UTC-8, Stefan Behnel wrote: >> And, not entirely unexpected, it breaks Sage pretty much completely: > Hm, the > DeprecationWarning: object() ta

Re: [Cython] [cython-users] which __new__ to use?

2014-01-10 Thread Stefan Behnel
Stefan Behnel, 10.01.2014 17:30: > Nils Bruin, 22.11.2013 00:10: >> With the following classes: >> >> cdef class A(object): >> cdef int a >> pass >> cdef class B(object): >> pass >> >> and the following multiply inherited classes: >> >> The problem arises >> >> class C(object): >>

Re: [Cython] [cython-users] which __new__ to use?

2014-01-10 Thread Stefan Behnel
Nils Bruin, 22.11.2013 00:10: > With the following classes: > > cdef class A(object): > cdef int a > pass > cdef class B(object): > pass > > and the following multiply inherited classes: > > The problem arises > > class C(object): > pass > class D(C,B): > pass > class F(B,C

Re: [Cython] cdef class tp_new should call PyBaseObject_Type.tp_new?

2014-01-10 Thread Simon Jagoe
Thanks, Stefan. Let me know if I can help in any way. I will track Cython master while I continue my port from C to Cython. On 10 January 2014 09:52, Stefan Behnel wrote: > Stefan Behnel, 10.01.2014 10:11: >> Simon Jagoe, 09.01.2014 14:04: Looking at the code in Py3, ISTM that it would be su

Re: [Cython] cdef class tp_new should call PyBaseObject_Type.tp_new?

2014-01-10 Thread Stefan Behnel
Stefan Behnel, 10.01.2014 10:11: > Simon Jagoe, 09.01.2014 14:04: >>> Looking at the code in Py3, ISTM that it would be sufficient to do this iff >>> >>> (t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) != 0 >>> >>> which should be rare enough. >>> >>> Obviously requires some user side testing to see

Re: [Cython] cdef class tp_new should call PyBaseObject_Type.tp_new?

2014-01-10 Thread Stefan Behnel
Simon Jagoe, 09.01.2014 14:04: >> Looking at the code in Py3, ISTM that it would be sufficient to do this iff >> >> (t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) != 0 >> >> which should be rare enough. >> >> Obviously requires some user side testing to see if it breaks any other >> code... > > T

Re: [Cython] cdef class tp_new should call PyBaseObject_Type.tp_new?

2014-01-10 Thread Simon Jagoe
Hi Stefan, > Looking at the code in Py3, ISTM that it would be sufficient to do this iff > > (t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) != 0 > > which should be rare enough. > > Obviously requires some user side testing to see if it breaks any other > code... Thanks for looking at this. I am