Many Similar Dialogs For Date Entry

Don Dwiggins ddwiggins at advpubtech.com
Mon Feb 5 09:41:43 PST 2007


Rich Shepard wrote:
> On Fri, 2 Feb 2007, Christopher Barker wrote:
> 
>> It's been said that the proper way to spell "switch ... case" in 
>> Pyhton is
>> NOT if..elif...elif, but rather a dictionary. Here's a simple example:
>>
>> http://simonwillison.net/2004/May/7/switch/
>>
>> A little more googling might find you more.
> 
>   Thanks, Chris. Chris M's example made it very clear.

The dictionary idiom actually gives you a bit more power than the switch 
statement.  For example, the definition of the dictionary can be located 
away from the point of invocation (or, if it's used repeatedly, from the 
points of invocation), and can even be imported from another module. 
Also, entries can be dynamically added to or removed from the dictionary.


-- 
Don Dwiggins
Advanced Publishing Technology





More information about the wxpython-users mailing list