[Python-Dev] Joys of Optimization
Raymond Hettinger
python at rcn.com
Fri Mar 12 10:49:03 EST 2004
[Michael Hudson]
> Just a couple of thoughts:
>
> 1) listextend_internal calls PyObject_Size twice, for no obvious
> reason.
Good eye. Will remove the duplicate call.
> 2) It's a little odd that listextend_internal consumes a reference to
> b. Perhaps a comment?
It probably was a good idea before all the refactoring because it
simplified the calling code and because the b argument was always a
temporary sequence. Now that there is only one caller, the
responsibility for the DECREF could be shifted back to the caller --
it's a matter of taste.
Raymond
More information about the Python-Dev
mailing list