General question about Python design goals

Paul Boddie paul at boddie.org.uk
Mon Nov 28 10:43:37 EST 2005


Antoon Pardon wrote:
> Duncan Booth wrote:
> > But you aren't illustrating that at all. You came up with an example which
> > showed, at least to me, a good argument why tuples should *not* have list
> > methods.

For what it's worth, I don't agree with that analysis, but anyway...

> No I gave an example, you would implement differently. But even
> if you think my example is bad, that would make it a bad argument
> for tuples having list methods. That is not the same as being
> a good argument against tuples having list methods.

In this case, I rather agree with the pragmatic responses earlier in
the thread: that it was probably an oversight that tuples lack the
count, index and (arguably) sorted methods, and that patches would
probably be welcome to rectify this state of affairs. Personally, I
find certain sequence-like characteristics of strings more irritating
on occasions, and if one had to convert strings to lists in order to
iterate over the characters (as one has to do in various other
high-level languages), I probably wouldn't find that so inconvenient.
But then, such a change would probably disrupt the existence of other
useful aspects of strings: index-based access to characters, slicing,
and so on. I'm therefore not inclined to shout about such matters in
such a way that I then have to defend my subjective line of thinking
whilst proposing an objectively acceptable alternative.

I actually think it's good to question certain aspects of the language
in the way being done in this thread, despite unconvincing attempts to
defend the status quo (and the ever present threat of a giant hedgehog
emerging from behind a building with large signs reading "Pythonic" and
"Zen of Python" stuck on its spines), but I personally wouldn't spend
too much time on such matters myself.

Paul




More information about the Python-list mailing list