Guido van Rossum wrote:

> Here's an argument for allowing names (this argument has been used
> successfully for using names instead of string literals in many APIs):
> if there is a spelling error in the string literal, the case will
> silently be ignored, and who knows when the bug is detected. If there
> is a spelling error in a NAME, however, the error will be caught as
> soon as it is evaluated.

which is the rationale for using names in SRE, of course.

and adding a proper switch statement will make this approach a bit 
robust; if all cases are marked as static (or made static by default), 
all case expressions will be evaluated up front.

</F>

_______________________________________________
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

Reply via email to