On Mon, Dec 3, 2012 at 8:31 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Consider this piece of legal Python code: > > Err = None > if condition(x) > 100: > Err = OneException > elif another_condition(x): > Err = AnotherException > try: > spam(a, b, c) > except Err: > recover()
Legal it may be, but are there times when you actually _need_ this level of dynamism? It strikes me as a pretty weird way of going about things. I agree with the point you're making, but this feels like a contrived example, and I'm curious as to whether it can be uncontrived. ChrisA -- http://mail.python.org/mailman/listinfo/python-list