tuples, index method, Python's design

Steve Holden steve at holdenweb.com
Tue Apr 10 10:57:25 EDT 2007


Carsten Haese wrote:
> On Tue, 2007-04-10 at 09:57 -0400, Steve Holden wrote:
>> I hear the screams of "just add the index() method to tuples and have 
>> done with it" and, to an extent, can sympathize with them. But that way 
>> lies creeping featurism and the next thing you know we'll have a ternary 
>> operator in the language - oh wait, we do now!
> 
> It would indeed be much easier to just give up. However, the resistance
> to tuple.index is more than a generic resistance to feature creep. As I
> have demonstrated elsewhere on this thread, any use case for tuple.index
> will be inherently obfuscated. Code clarity is a major design goal of
> Python, and adding tuple.index would be contrary to this goal.
> 
> I'm just a user with no influence on the development of Python itself,
> but in my humble opinion, the non-existence of tuple.index is more
> pythonic than its existence would be.
> 
I quite agree. I was not advocating it as a serious course of action, 
more admiring its noise-reduction potential. I'm no great fan of the if 
... else expression either, come to that.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb     http://del.icio.us/steve.holden
Recent Ramblings       http://holdenweb.blogspot.com




More information about the Python-list mailing list