[Info] PEP 308 accepted - new conditional expressions
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

[Info] PEP 308 accepted - new conditional expressions

From: Reinhold Birkenfeld <reinhold-birkenfeld-nospam@wolke7.net>
Date: Fri Sep 30 2005 - 15:09:29 CEST

Hi,

after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:

X if C else Y

which is the same as today's

(Y, X)[bool(C)]

or

C and X or Y (only if X is True)

Reinhold
Received on Sat Oct 15 03:59:57 2005