Naming future objects and their methods

Almar Klein almar.klein at gmail.com
Sun Apr 15 05:58:39 EDT 2012


Hi Stefan,

What do you think would be a "natural" way to name the
> future returned by `put_bytes` and possibly the `was_sent`
> method attached to it? Can you even come up with nice naming
> rules for futures and their methods? :-)
>

I think the intended way to get notified when a future is done is to
register a callback using future.add_done_callback(). If you want to
wait for the result value, you should use the future.result(timeout) method.

As for how to name the future object, what about simply "future"?

See also:
http://docs.python.org/dev/library/concurrent.futures.html#future-objects

Regards,
  Almar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120415/b54dcce9/attachment-0001.html>


More information about the Python-list mailing list