Stefan Behnel wrote:

So, would it still be Python if it folded

    1 + "1"

into

    raise TypeError()

at compile time?

It would have to be

   raise TypeError("Exactly the message that would have been produced at run 
time")

That might be acceptable, but then you have to ask, is it really
worth performing this optimisation? The overhead of raising and
handling the exception is likely to completely swamp that of
executing the original code.

--
Greg
_______________________________________________
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

Reply via email to