Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple, elegant, pythonic solution for switch statement

Skip to first unread message

python_only

unread,
Apr 26, 2005, 3:15:09 AM4/26/05
to
Check it out!

Readable switch construction without lambdas or dictionaries:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692

Klaus Alexander Seistrup

unread,
Apr 26, 2005, 3:47:00 AM4/26/05
to
python_only wrote:

> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410692

Neat solution!

--
Klaus Alexander Seistrup
Magnetic Ink, Copenhagen, Denmark
http://magnetic-ink.dk/

bruno modulix

unread,
Apr 26, 2005, 5:37:24 AM4/26/05
to
Not sure I'll have a need for it, but, yes, nice job !-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'on...@xiludom.gro'.split('@')])"

0 new messages