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/101823.html below:

[Python-Dev] PEP 3148 ready for pronouncement [ACCEPTED]

[Python-Dev] PEP 3148 ready for pronouncement [ACCEPTED]Brian Quinlan brian at sweetapp.com
Mon Jul 12 23:36:18 CEST 2010
On 13 Jul 2010, at 00:59, Titus von der Malsburg wrote:

> On Tue, Jul 13, 2010 at 12:48:35AM +1000, Nick Coghlan wrote:
>> On Tue, Jul 13, 2010 at 12:19 AM, Titus von der Malsburg
>> That's what actually happens, so you can code it either way
>
> That's great!  None of the examples I found used the pythonic
> exception style, that's why I assumed that checking the "return value"
> is the only possibility.  Reading the PEP carefully would have helped.
> :-)

I'd add that it would feel more natural to me to write:

  try:
    print('%r page is %d bytes' % (url, len(future.result())))
- except FutureError:
-   print('%r generated an exception: %s' % (url, future.exception()))
+ except FutureError as e:
+   print('%r generated an exception: %s' % (url, e))

Cheers,
Brian
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