A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-July/101367.html below:

[Python-Dev] Can Python implementations reject semantically invalid expressions?

[Python-Dev] Can Python implementations reject semantically invalid expressions? [Python-Dev] Can Python implementations reject semantically invalid expressions?Terry Reedy tjreedy at udel.edu
Fri Jul 2 22:44:55 CEST 2010
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4