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/101387.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?Greg Ewing greg.ewing at canterbury.ac.nz
Sat Jul 3 03:31:18 CEST 2010
Steven D'Aprano wrote:
> if the keyhole optimizer raised SyntaxError (or 
> some other exception) on seeing this:
> 
> def f():
>     return 1 + "1"

That might break code that was deliberately trying to raise
an exception. Sometimes you see things like

   try:
     1/0
   except Exception, e:
     ...

Usually this kind of thing is only done in test code or
illustrative snippets, but even so, it should work as
expected.

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