John J Lee wrote: >> In your formulation the comma binds more tightly than the as keyword. >> In import statements it's the other way around. That seems like it >> might be a source of confusion. > > Perhaps parentheses around the exception list should be mandatory for the > 2-or-more exceptions case? > > except NameError as e: --> fine > except (NameError) as e: --> fine > except (NameError,) as e: --> fine > > except NameError, OtherError as e: --> SyntaxError > except (NameError, OtherError) as e: --> fine
I don't like that particularly, but I guess that for consistency's sake it would have to be done this way. Cheers, Georg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com