[Python-Dev] Tuples vs. lists

Aahz Maruch aahz@rahul.net
2002年1月24日 08:56:38 -0800 (PST)


Guido van Rossum wrote:
>Fred:
>>>> Do you seriously object to changing it to a tuple???
>> Yes, I don't want to create any more show code examples that use
> tuples for (conceptually) arbitrary-length arrays of homogeneous
> data. The data type to use for those is lists.

Hrm. Even when it's something that's supposed to be immutable? I'm
asking because I'm currently using a tuple for the digit list in my BCD
module, and I'd like a clearer explanation of why you think that it
should be a list (assuming you do).
>From my viewpoint, the BCD digit string should be handled like a string;
I'm only using a tuple for efficiency of storing numbers instead of
characters.
-- 
 --- 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.

AltStyle によって変換されたページ (->オリジナル) /