On Sat, 18 Nov 2017 10:13:36 +0100 Victor Stinner <victor.stin...@gmail.com> wrote: > > Anyway, the PyTuple_GET_ITEM() will remain a macro in the default API for > Python 3.7. > > See also my blog post which explains why the fact that it is a macro > prevents us from optimizing it, like having specialized compact tuple for > small integers.
I'm not sure this would be an optimization. You'll add checks to PyTuple_GET_ITEM() to select the "kind" of tuple at runtime, and this may very well make things slower. You would need a JIT with type constraints to remove the overhead and truly gain from the optimization. Besides, PyTuple_GET_ITEM() can't really get any faster if all you care about is the *objects* in the tuple, not their value. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com