Naming future objects and their methods

Michael Torrie torriem at gmail.com
Sun Apr 15 09:51:47 EDT 2012


On 04/14/2012 04:22 PM, Stefan Schwarzer wrote:
> However, I'm not comfortable with the combination of the
> names of the future and its method. After all, not the
> `put_result` was sent, but the data that was the argument in
> the `put_bytes` call. Maybe `data_was_sent` is better than
> `was_sent`, but `put_result.data_was_sent()` doesn't feel
> right either.
> 
> 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 tried to find suggestions by using a search engine and
> StackOverflow, but wasn't successful. PEP 3148 [3] describes
> an API, but it's quite abstract (`Executor.submit`,
> `Future.result` etc.).

You might look at the Python Twisted asynchronous library for ideas.



More information about the Python-list mailing list