[Python-Dev] Simple Switch statement

Guido van Rossum guido at python.org
Mon Jun 26 16:29:04 CEST 2006


On 6/26/06, Michael Urman <murman at gmail.com> wrote:
> I also would like to see a way to use 'is' instead of (or inaddition
> to) '==' for the comparison, but I don't have any use cases behind
> this.

I've thought about this a bit, and I think it's a red herring. I've
seen some places where 'is' is used to compare constants (e.g.
sre_compare.py). But I'm pretty sure that this is a speed hack that
can safely be forgotten once (if ever) we have a switch statement.
-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list