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

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

[Python-Dev] PEP 3148 ready for pronouncement [ACCEPTED] [Python-Dev] PEP 3148 ready for pronouncement [ACCEPTED]Titus von der Malsburg malsburg at gmail.com
Mon Jul 12 16:19:19 CEST 2010
Hi I learned about the futures PEP only today.  I saw the example on
http://code.google.com/p/pythonfutures/

One thing that worries me is that this approach seems to bypass the
usual exception handling mechanism of Python.  In particular I'm
wondering why you have to do things like:

  if future.exception() is not None:
    ...

This reminds me a lot of how things are done in C but it's not very
pythonic.  Wouldn't it be possible and nicer to raise the exception --
if there was one inside the asynchronous job -- when the result of the
future is accessed?

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

  Titus
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