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/2005-February/051448.html below:

[Python-Dev] list of constants -> tuple of constants

[Python-Dev] list of constants -> tuple of constants [Python-Dev] list of constants -> tuple of constantsSkip Montanaro skip at pobox.com
Sun Feb 6 20:13:51 CET 2005
    Raymond> [Skip]
    >> If lists are conceptually like vectors or arrays in other languages
    >> and tuples are like C structs or Pascal records, then by converting
    >> from list to tuple form you've somehow muddied the data structure
    >> water just to take advantage of tuples' immutability.

    Raymond> In the context of literals used with the "in" operator,
    Raymond> practices are widely divergent within the standard library and
    Raymond> within the tutorial.

Then perhaps we should strive to make the standard library and tutorial more
consistent.  Answers to questions on c.l.py often advocate the standard
library as a good source for example code.

    Raymond> It seems that the list-as-arrays-tuple-as-records guideline is
    Raymond> not meaningful or applicable in the context of the "in"
    Raymond> operator.  Proscribing tuple.__contains__ and tuple.__iter__
    Raymond> carrys the notion a bit too far.

I agree that the presence of __contains__ and __iter__ kind of blurs the
distinction between the concept of sequence and struct.

Skip
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