Python as Guido Intended

Steve Holden steve at holdenweb.com
Thu Nov 24 07:21:56 CET 2005


bonono at gmail.com wrote:
> Mike Meyer wrote:
[...]
> 
>>By the results of the vote, most people wanted ternary. The use
>>cases for it are well know. From what I recall, the debate was over
>>which of the many proposals should be adopted.
> 
> That is not the impression I get on here. The impression I get lately
> is "ternary" is bad, is hard to read, can always be done "better" with
> if then else statement.
> 
Well I personally believe the main reason Guido resisted the 
introduction of the ternary operator for so long is precisely because he 
knows it will be "abused" (by which I mean "used when its use will make 
a program's meaning less clear") to the detriment of program readability.

Python's unusual virtue is its ability to make a programmer's intent 
clear from a reading of the code, and Guido tends to be fiercely 
protective of that characteristic.

You should also bear in mind that many (though admittedly not all) 
suggestions for change are ill-thought-out at best and lamebrained at 
worst. One recent example (though I won't accord it a specific position 
on the scale) was the suggestion that user-defined operators could be 
introduced using a "]+[" syntax. The fact that this made

     y = [1,2,3]+[4,5,6]

syntactically ambiguous had not been considered by the proposer.

I agree that sometimes those who shoot such proposals down in flames 
might be more considerate of the feelings of the proposers, but life is 
short and we are all imperfect.

The fact that naive expressions of opinion about such matters are 
traditionally accorded respect and answered politely is one of the 
reasons why so many people find this list a helpful place to discuss Python.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list