[Python-Dev] Re: Trinary Operators

Guido van Rossum guido@python.org
Thu, 06 Feb 2003 15:44:03 -0500


> Are they really equivalent?  What about
> 
>     print h() if f() and g()
> 
> versus
> 
>     if f() and g():
>         print h()
> 
> Does g() get called if f() is false?  What about h()?

Do you know the ternary operator in C?

--Guido van Rossum (home page: http://www.python.org/~guido/)