On Dec 8, 9:36 pm, Asun Friere <afri...@yahoo.co.uk> wrote: > This code is probably symptomatic of poor design. (Not to mention that > your condition tests). For which reason python has no 'case' > statement and why no decent OO language should. > > It is a principle of OO design that "an object should know what to do > itself." Rather running an object though a series of tests, it is > better to send the object a message, relying on polymorphism or duck- > typing, and deal with any exceptions thrown.
What if the object is a string you just read from a file? How do you dispatch using polymorphism in that case? Carl Banks -- http://mail.python.org/mailman/listinfo/python-list