[Python-Dev] Tuples vs. lists (original) (raw)

Aahz Maruch aahz@rahul.net
Mon, 4 Feb 2002 06:40:20 -0800 (PST)


Guido van Rossum wrote:

Aahz:

It's a constant. The BCD module is Binary Coded Decimal; instances are intended to be as immutable as strings and numbers (well, it is a number type). Modifying an instance is guaranteed to produce a new instance. To a large extent, I guess I feel that if a class is intended to be immutable, each of its underlying data attributes should also be immutable. Or you could assign it to a private variable.

And in private e-mail, Guido writes:

I hate to continue harping on this tiny item in public, but what woud you do if you needed a constant dictionary?

All right, I guess it's time for me to just follow the Python motto: "There's only one way, and that way is Guido's."

                  --- Aahz (@pobox.com)

Hugs and backrubs -- I break Rule 6 <*> http://www.rahul.net/aahz/ Androgynous poly kinky vanilla queer het Pythonista

We must not let the evil of a few trample the freedoms of the many.