On 14 April 2010 21:59, Robert Bradshaw <[email protected]> wrote: > On Apr 14, 2010, at 5:23 PM, Lisandro Dalcin wrote: > >> I've finally managed to get rid of unused docstrings: >> http://hg.cython.org/cython-devel/rev/5848ee0eca01 > > Thanks! You're making great progress on totally warning-free test runs. >
Yep, that's my intention... >> It was not that easy to figure out the right way, as some special >> methods are added both to typeobject slots and pymemberdef slots with >> METH_COEXISTS... BTW, unrelated to docstrings, perhaps METH_COEXISTS >> usage could provides room for further optimizations. > > The METH_COEXISTS is what allows us to give any typeslot function an > optimized wrapper (with doctstring). The reason its not done for > __contains__, __len__, etc. is that they return non-object values > (though it should be easy to create our own wrappers, with optimized > calling conventions and proper docstrings). > Yes, it should be easy... Hopefully, Stefan will beat us :-) , though... Do anyone have actual numbers about the gains? > For introspection purpose, we could even create "wrappers" for > __cinit__/__dealloc__ that would simply raise errors saying that these > are not meant to be called directly (or let them be some kind of non- > callable object with a docstring). This wouldn't use the METH_COEXISTS > structure, as there aren't any existing wrapper methods. > Now that you say it... The name "__dealloc__" always hurts my eyes...The method does not do any "deallocation", so the name is IMHO very misleading... I would love to introduce a __cdel__ alias for it, then we would have near-to-perfect symetry __init__/__del__ and __cinit__/__cdel__ ... -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
