Python handles globals badly.

Antoon Pardon antoon.pardon at
Wed Sep 9 17:04:00 CEST 2015

Op 09-09-15 om 05:27 schreef Steven D'Aprano:
>> Were those polls, like the poll he once did for the condtional expression?
>> There the poll indicated no specific proposal had a majority, so for each
>> specific proposal one could say it didn't have popular support, but the
>> majority still prefered to have a conditional expression. But at that
>> time Guido used that poll as an indication there was not enough support.
> In the case of conditional expression, there is *no good alternative*.

Yet there were people who passionatly argued against introducing one.
Even when list comprehensions were introduced where they really would
be useful some people still fought it.

Just to show that people fighting something is not a strong argument.

> Using if...then statement is too heavyweight, and cannot be used in an
> expression. Using "flag and true_value or false_value" is buggy -- it fails
> if true_value is itself false. Refactoring it to a function uses eager
> rather than lazy evaluation. So there was no existing alternative to a
> ternary if expression that worked correctly.

Yes there was. There were even two. One was packing your values into
a one element list, the other was packing them in a lambda. It was ugly
but it was what people came up with for lack of better.

> In the case of case/switch, there is no consensus on what the statement
> should do, how it should work, what purpose it has, or what syntax it
> should use. Rather than "there's no alternative to a case statement", the
> situation was more like "there are many good alternatives to the various
> different case statements people want".

Since when does Guido need a consensus? Look the developers have only limited
time, and they get to choose what they consider a priority and what they don't.
And if they think other things have higher priority, fine by me. But don't
come with, no support/consensus with the users, because if the dev-team thinks
something is a good idea, they'll implement it without much consideration for
support/consensus among the users.

Antoon Pardon 

More information about the Python-list mailing list