[Python-Dev] re: syntax - "Aren't tuples redundant?"

Fredrik Lundh fredrik@pythonware.com
Fri, 4 Feb 2000 15:44:13 +0100


Greg Wilson wrote:
> > Because ints and floats differ in meaning?
> People are taught "whole numbers" vs. "fractions" at an early age.

sure, but are they taught that what looks like fractions are
treated as integers, and that small integers don't auto-
matically become large integers when necessary? ;-)

> Interestingly, I've also never had trouble with strings being =
immutable. I
> point out to people that the number 123 isn't mutable, and that
> supposedly-mutable strings in other languages are really
> allocating/deallocating memory behind your back; everybody nods, and =
we
> carry on.

interesting indeed.  seems to me as if the best way to
avoid list/tuple confusion is to start by introducing the
basic types (numbers, strings, tuples, which are all
immutable), *before* explaining that python also
supports mutable container types (lists, dictionaries,
instances, etc)?

</F>