At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: >BTW a switch in a class should be treated the same as a global switch. >But what about a switch in a class in a function?
Okay, now my head hurts. :) A switch in a class doesn't need to be treated the same as a global switch, because locals()!=globals() in that case. I think the top-level is the only thing that really needs a special case vs. the general "error if you use a local variable in the expression" rule. Actually, it might be simpler just to always reject local variables -- even at the top-level -- and be done with it. _______________________________________________ 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