Ka-Ping Yee wrote: > On Wed, 21 Jun 2006, Phillip J. Eby wrote: >> Well, EIBTI and all that: >> >> switch x: >> case == 1: foo(x) >> case in S: bar(x) >> >> It even lines up nicely. :) > > Hmm, this is rather nice. I can imagine possible use cases for > > switch x: > case > 3: foo(x) > case is y: spam(x)
Ha, a slight reminiscence of BASIC... > case == z: eggs(x) > > An interesting use case for which this offers no corresponding > syntax is > > case instanceof ClassA: ham(x) > > which doesn't work because Python spells a type test as > isinstance(a, b) rather than with an operator. (I suppose > whether we want it to be an operator might be another > question to think about for Python 3000.) FWIW, I like "is a" most, but there's no way to spell this as one word without confusing readers. 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