Help understanding the decisions *behind* python?

Raymond Hettinger python at rcn.com
Fri Jul 31 23:43:17 CEST 2009


> > While nothing in the list/tuple code requires you to make that
> > distinction,
> > it is important because that philosophy pervades the language.  If you
> > follow Guido's direction, you'll find that the various parts of the
> > language fit together better.  Do otherwise and you'll be going
> > against
> > the grain.
>
> I might be wrong, but I get the impression that many people don't indeed "get
> it" and use tuples as static arrays and lists when the array needs to be
> dynamically resized. This is certainly how I use them as well.
>
> This would tend to show that Guido's notion here was not particularly
> intuitive.

No, it just shows that they are not Dutch ;-)

IIRC, Aahz once made an eloquent statement about how languages aren't
intuitive because different people have different intuitions.  The
fact
is that every language has its own set of ways.  People usually pick-
up
on what is Pythonic in a short order.  The problem comes when people
decide-in-advance how the language ought to be -- it takes them longer
to pick-up the culture and idioms.  More than one person here has
observed that the time to learn to program Pythonically is inversely
proportional to their experience in Java.

It is perfectly okay for you to use tuples for statically sized
arrays.
That isn't wrong.  It is against then grain though.  Guido articulated
his concept early and many of his minions (me included) have designed
the APIs and optimizations to flow nicely with his preferred way of
doing things.


Raymond



More information about the Python-list mailing list