Builtin function versus new syntax for PEP308 -- was Re: PEP308: Yet another syntax proposal

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Wed Feb 12 02:14:41 CET 2003


> From: Gareth McCaughan [mailto:Gareth.McCaughan at pobox.com]
> 
> What's the actual *disadvantage* of short-circuiting? Is it only that
> if you have to short-circuit then you can't just write a new builtin
> and be done with it?

Control flow is not explicit. As I stated on another thread (damn - I was trying not to get involved in this too much ;) I have yet to read a ternary which *relies* on short-circuiting without needing to think hard about it.

Control flow should be explicit. Anything which participates in a short-circuiting expression should behave identically if the short-circuiting were not present. Short-circuiting should be an optimisation only.

i.e. You shouldn't have side-effects in a short-circuiting expression.

Tim Delaney





More information about the Python-list mailing list