Hi, Lisandro Dalcin wrote: > On Wed, Sep 10, 2008 at 4:04 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> 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*);
Fine with me. >> 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'm not talking about a semantic difference, the interning itself is just more overhead, so it's not worth doing unless you know it will be payed for by the usage later on. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
