On 7/2/2010 12:43 AM, Glyph Lefkowitz wrote:
def f(): return 1 + "1"
instead of compiling something which can't fail to raise an
exception, would that still be a legal Python implementation?
I'd say "no". Python has defined semantics in this situation: a
TypeError is raised.
The manuals are rather inconsistent about defining the exception
semantics. Some parts define the exception returned. Other, equivalent
parts, do not. I should start a separate thread on this when I find the
examples I once had.
--
Terry Jan Reedy
_______________________________________________
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