A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-February/071304.html below:

[Python-Dev] Py2.6 ideas

[Python-Dev] Py2.6 ideas [Python-Dev] Py2.6 ideasJosiah Carlson jcarlson at uci.edu
Wed Feb 21 05:20:52 CET 2007
Larry Hastings <larry at hastings.org> wrote:
> For new code, I can't think of a single place I'd want to use a 
> "NamedTuple" where a "record" wouldn't be arguably more suitable.  The 
> "NamedTuple" makes sense only for "fixing" old APIs like os.stat.


I disagree.

    def add(v1, v2)
        return Vector(i+j for i,j in izip(v1,v2))

    x,y,z = point

And more are examples where not having a defined ordering (as would be
the case with a 'static dict') would reduce its usefulness.  Having a
defined ordering (as is the case of lists and tuples) implies
indexability (I want the ith item in this sequence!).  It also allows
one to use a NamedTuple without change otherwise anywhere you would have
previously used a tuple (except for doctests, which would need to be
changed).  This was all discussed earlier.

 - Josiah

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4