At 12:44 AM 6/12/2006 +0200, Fredrik Lundh wrote: >the compiler can of course figure that out also for if/elif/else state- >ments, by inspecting the AST. the only advantage for switch/case is >user syntax...
Not quite true - you'd have to restrict the switch expression in some way, so you don't have: if x.y == 1: ... elif x.y == 2: ... where the compiler doesn't know if getattr(x,'y') is really supposed to happen more than once. But I suppose you could class that as syntax. _______________________________________________ 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