[Python-Dev] Re: [Python-checkins] python/dist/src/Doc/api abstract.tex, 1.30, 1.31 (original) (raw)

Skip Montanaro skip at pobox.com
Fri Mar 12 07:07:55 EST 2004


raymond> Modified Files:
raymond>    abstract.tex 
raymond> Log Message:
raymond> Use a new macro, PySequence_Fast_ITEMS to factor out code
raymond> common to three recent optimizations.  Aside from reducing code
raymond> volume, it increases readability.

Isn't it actually _PySequence_Fast_ITEMS (private API because of the leading underscore)? Here's one diff chunk from listobject.c:

***************
*** 692,701 ****

        /* populate the end of self with b's items */
!   if (PyList_Check(b)) 
!           src = ((PyListObject *)b)->ob_item;
!   else {
!           assert (PyTuple_Check(b));
!           src = ((PyTupleObject *)b)->ob_item;
!   }
        dest = self->ob_item + selflen;
        for (i = 0; i < blen; i++) {
--- 687,691 ----

        /* populate the end of self with b's items */
!   src = _PySequence_Fast_ITEMS(b);
        dest = self->ob_item + selflen;
        for (i = 0; i < blen; i++) {

Skip



More information about the Python-Dev mailing list