On 26 May 2011 16:00, Amaury Forgeot d'Arc <[email protected]> wrote: > 2011/5/26 William ML Leslie <[email protected]>: >> The python tuple is intended to be a heterogeneous data structure, as >> they are in RPython. The length of a tuple is conceptually part of the >> type, which means that tuple length will be static in sane code >> anyway. > > But does this apply to the *args tuple?
Good point - you mean "sometimes, frequently not". In the context we are considering, namely promotion of tuple length for small tuples, I want to pretend the answer is yes. It means that we get call-site specialisation for heterogeneous usage, and ignore it for most homogeneous usage. Heterogeneous *args usage is probably common enough - for example, in wrapping decorators, it is common to accept and pass *args and **kwargs to the wrapped function, and if the length of the tuple were promoted, the pack and unpack could be simplified. I suspect that limiting the discussion to /small/ tuples will take care of the outliers, but benchmarks are a good idea. -- William Leslie _______________________________________________ pypy-dev mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-dev
