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

Reply via email to