Core CPython is not consistent about this. What should we do in
Cython? Should we report this to Python-Dev?

Long story:

In core CPython (svn trunk), at Objects/longobjects.c, you should see
that in almost all cases OverflowError is raise. But see this one:

int
_PyLong_AsByteArray(PyLongObject* v,
                    unsigned char* bytes, size_t n,
                    int little_endian, int is_signed)
{
<...>
                if (!is_signed) {
                        PyErr_SetString(PyExc_TypeError,
                                "can't convert negative long to unsigned");
                        return -1;
                }
<...>
}


-- 
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