Trying to undestand why creating and manipulating futures a bad practice

后端 未结 1 373
Happy的楠姐
Happy的楠姐 2020-12-19 16:09

I\'m trying to understand futures in Python by reading the PyMotW guide.

I asked a question yesterday, and in the comments, it was stated that:

<
1条回答
  •  轮回少年
    2020-12-19 16:45

    Thanks to @user4815162342, for providing a link to the async/await presentation by Yury Selivanov.

    I managed to reach out and ask him. Here is what he said.

    The warning is there because Future is a low-level API. You should use it to build async/await facade around existing callbacks-based code. But if you are writing async/await code from scratch, there are higher-level builtin async/await APIs in asyncio that are just easier to use (and less error prone).

    0 讨论(0)
提交回复
热议问题