[Cython] [PATCH] Make __Pyx_ArgTypeTest() use "const char*" to suppress warning
Lisandro Dalcin
dalcinl at gmail.com
Wed Sep 10 21:42:34 CEST 2008
On Wed, Sep 10, 2008 at 4:04 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Hi,
> We are totally not discussing our own GetAttrString() at this point (which is
> only used in a couple of less important places anyway).
But if GetAttrString() is still used in C code, then it has to handle
the different signatures for 2.3/24 and 2.5/2.6/3.0. So then perhaps
the less intrusive change is to generate a custom function
PyObject* __Pyx_GetAttrString(PyObject*, const char*);
> Interning the string at module init time would only pay off if it's used
> elsewhere in a performance critical part of the code later on, which is not so
> likely for a class name.
I actually agree in this point, but perhaps the approach I commented
above still applies.
I do not see any semantic difference in using PyString_FromString() or
PyString_InternFromString(). Both calls return a new reference you own
and next have to DECREF. I do not really have any strong complaint
about Stefan's way for the particular case of importing a type from a
module.
--
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
More information about the Cython-dev
mailing list