On 6/24/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > [...] a syntactic nit that Eric Sumner pointed out. Since > it involves iteration over x to populate the jump table rather than doing a > containment test on x, using 'case in x' is misleading. It would be better > written as 'case *x'. > > Then: > 'case 1:' ==> a switch value of 1 will jump to this case > 'case 1, 2:' ==> a switch value of 1 or 2 will jump to this case > 'case *x' ==> any switch value in x will jump to this case > 'case *x, *y' ==> any switch value in x or y will jump to this case
I'm +0 on this idea, or something similar (maybe my original 'case in' syntax with 'in' replaced by '*'. I'm going to have to sleep on Nick's 'once' proposal (which deserves a separate thread). -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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