For review: PEP 308 - If-then-else expression

holger krekel pyth at devel.trillke.net
Fri Feb 7 15:07:19 EST 2003


Skip Montanaro wrote:
> 
>     holger> What about a missing else clause? e.g. 
> 
>     holger>         <expression> if <condition>
> 
>     holger> Allowing it could be nice for stuff like 
> 
>     holger>     result = obj(...) if callable(obj)
> 
> If obj is not callable, what is assigned to result?

forget to mention:  None

sorry for beeing unclear. See my other post for more
on this but note that i am not particularly in favour
of anything regarding the PEP, yet.  IOW i don't
strongly advocate an optional 'else' but thought
it's worth thinking about it. 

    holger





More information about the Python-list mailing list