ternary operator
Chad Netzer
cnetzer at mail.arc.nasa.gov
Tue Feb 4 18:25:03 EST 2003
More information about the Python-list mailing list
Tue Feb 4 18:25:03 EST 2003
- Previous message (by thread): ternary operator
- Next message (by thread): ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 2003-02-04 at 14:44, David Gausebeck wrote: > I've recently started using python from a primarily C/C++ background, > and one of the annoyances that I ran into right away was the lack of a > ternary ?: operator. Some people have advocated: (b,c)[not a] which is comparable (except for the shortcutting evaluation) to: a ? b : c Best to use it sparingly, or only when you require a lot of it at once (and can write a brief local comment to explain it), IMO. -- Bay Area Python Interest Group - http://www.baypiggies.net/ Chad Netzer (any opinion expressed is my own and not NASA's or my employer's)
- Previous message (by thread): ternary operator
- Next message (by thread): ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list