[Python-Dev] Py2.6 ideas
rasky at develer.com
Fri Feb 16 02:35:33 CET 2007
On 15/02/2007 20.59, Raymond Hettinger wrote:
> * Add a pure python named_tuple class to the collections module. I've been
> using the class for about a year and found that it greatly improves the
> usability of tuples as records.
+1 from me too, I've been using a class with the same name and semantic
(though an inferior implementation) for almost two years now, with great benefits.
As suggested in the cookbook comment, please consider changing the semantic of
the generated constructor so that it accepts a single iterable positional
arguments (or keyword arguments). This matches tuple() (and other containers)
in behaviour, and makes it easier to substitute existing uses with named tuples.
More information about the Python-Dev