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