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/2003-March/033964.html below:

[Python-Dev] Ridiculously minor tweaks?

[Python-Dev] Ridiculously minor tweaks? [Python-Dev] Ridiculously minor tweaks?Guido van Rossum guido@python.org
Tue, 11 Mar 2003 21:11:12 -0500
> There are many places in the standard library where some code either
> iterates over a literal list or checks for membership in a literal
> list.  I'm curious if it would be considered productive and useful
> to go through and change those places to iterate over/check for
> membership in literal tuples instead fo lists.  The tuple, I think,
> more closely reflects the read-only literal nature of the code and
> is slightly faster to boot.

-1.

I bet you can't prove the speed-up.

Tuples are for heterogeneous data, list are for homogeneous data.
Tuples are *not* read-only lists.

Tuples require extra care in case the number of elements shrinks to 1.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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