On Mon, Dec 7, 2009 at 3:29 PM, Robert Bradshaw
<[email protected]> wrote:
>
> Is there a way to detect whether the way its been changed is backward
> compatible?
>

NumPy exposes an API version number. However, I'm not sure if that
would be enough to detect if a change is backwards.


>
> I'd rather be overly cautious.
>

Indeed. However, I think Cython should switch from an error to a
warning. That way, everybody should be more or less happy.

>
> I don't think it's strange
> to have to recompile when a C-level dependancy changes, even if the
> change is compatible.
>

You are right, but developers should keep in mind that having to
recompile is a major hurdle for other end-users.

>
> I'm still a bit confused though--numpy types are declared as "extern"
> so I wouldn't expect their size to be checked.
>

This is not the case. The code is here:


#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const
char *class_name, long size)
{
.....
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
....
}
#endif


So, in short, what about making this at least a (silenceable) warning,
instead of an (unrecoverable) error ?



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to