Stefan Behnel wrote: > Robert Bradshaw, 03.11.2009 10:22: > >> On Oct 25, 2009, at 11:53 AM, Lisandro Dalcin wrote: >> >>> I think Cython could generate a custom, inline function >>> implementing l.pop([n]) and fast dispatch to it if the object is >>> exactly a list ... >>> >> http://hg.cython.org/cython-devel/rev/2e3dda4a7d23 >> > > Hmm, is this really worth the code duplication with CPython? I mean, we are > partly copying the list-shrink trigger algorithm here, which I would prefer > to consider an implementation detail of the list type. > I second this, this is the kind of code I don't like to see Cython output. At the very least, one should #IFDEF it to only kick in with known good Python versions...it's not the kind of thing we'll automatically remember to check when Python 3.4 comes out.
It should be possible to find a middle route somewhere though? (At the very least prefetch "pop" of the list type rather than use getattr every time.) Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
