FW: Switch statements again

Steven Scott bodoni26 at resnet.gatech.edu
Wed Jan 15 18:21:40 EST 2003


Quoting Steven Scott <Steven.Scott at Synchrologic.com>:
> 
> If/elif/else remains the most common method.  If Python ever gains
> something
> like a switch statement you can bet the farm it won't have a "fall thru"
> feature though, so the way you've coded your C switch statement wouldn't
> work.
> 

but the absolute /only/ reason you'd use a switch over an if (besides
looking better) is fall through.

anyway, I'm not counting on python getting a switch.  I'll just get around
to writing my pre-processor one day that takes brackets, semi-colons,
switch's, for's (not foreach like python), and do-while.  and then I'll be
happy:)

-- 
Steven Scott [Bodoni26 at resnet.gatech.edu]
Don't give up fighting, 'til nothing else stands in your way..Don't
give up talking, until there's nothing left to say....But no matter





More information about the Python-list mailing list