Re: [Info] PEP 308 accepted - new conditional expressions
- From: Rocco Moretti <roccomoretti@xxxxxxxxxx>
- Date: Fri, 30 Sep 2005 13:53:41 -0500
Reinhold Birkenfeld wrote:
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
Any word on chaining?
That is, what would happen with the following constructs:
A if B else C if D else F A if B if C else D else F
The first one is the tricky bit - it could be either
(A if B else C) if D else F or A if B else (C if D else F)
I'd expect the former from left-> right semantics, but reading the unparenthesized form, I'd see "A if B else ..." note that B is true, and conclude the expression evaluated to A (which would be wrong if D is false).
.
- Prev by Date: Python 3! Finally!
- Next by Date: Re: Sybase Python WinXP
- Previous by thread: Re: [Info] PEP 308 accepted - new conditional expressions
- Next by thread: Re: what does 0 mean in MyApp(0)
- Index(es):