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/2007-January/070714.html below:

[Python-Dev] syntax misfeature (exception)

[Python-Dev] syntax misfeature (exception) [Python-Dev] syntax misfeature (exception)Georg Brandl g.brandl at gmx.net
Sat Jan 20 16:28:31 CET 2007
Neal Becker schrieb:
> I accidentally wrote:
> 
> try:
>  ...
> except a,b:
> 
> rather than:
> 
> try
>  ...
> except (a,b):
> 
> It appears that the 1st example syntax is silently accepted, but doesn't
> seem to work.  Is this true?  If so, I'd say it's a wart.

Both have a meaning: The first assigns the exception object to b, while the
second catches exception types a and b.

BTW, in Python 3.0, the first will be spelled "except a as b".

Please post questions about using the language to the comp.lang.python group.

cheers,
Georg

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