Trinary operator?

Cliff Wells logiplexsoftware at earthlink.net
Wed Apr 24 17:13:37 EDT 2002


On 24 Apr 2002 22:57:20 +0200
Oyvind Gronnesby wrote:

> * Cimarron Taylor
> |
> | Will this do what you want?
> | 
> | verboseGender = ('female','male')[gender=='m']
> 
> Wouldn't this break in a PEP 285 Python world?

No.  That was the whole point of subclassing bool from int.

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308





More information about the Python-list mailing list