Antoon Pardon wrote: > Which is why I don't understand the resistance against introducing > such a beast.
The idea has already been discussed to death. Read PEP 308 to see what was proposed, discussed, and why the PEP was eventually rejected: http://www.python.org/peps/pep-0308.html: > Status: Rejected > ... > Requests for an if-then-else ("ternary") expression keep coming up > on comp.lang.python. This PEP contains a concrete proposal of a > fairly Pythonic syntax. This is the community's one chance: if > this PEP is approved with a clear majority, it will be implemented > in Python 2.4. If not, the PEP will be augmented with a summary > of the reasons for rejection and the subject better not come up > again. While the BDFL is co-author of this PEP, he is neither in > favor nor against this proposal; it is up to the community to > decide. If the community can't decide, the BDFL will reject the > PEP. > ... > Following the discussion, a vote was held. While there was an > overall > interest in having some form of if-then-else expressions, no one > format was able to draw majority support. Accordingly, the PEP was > rejected due to the lack of an overwhelming majority for change. > Also, a Python design principle has been to prefer the status quo > whenever there are doubts about which path to take. -- http://mail.python.org/mailman/listinfo/python-list