This is already supported with [`asyncio.wait_for()`](
https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for).
For example: `await asyncio.wait_for(asyncio.Event().wait(), timeout=60)`
___
Python-ideas mailing list -- python-ideas@python.o
It would be very nice if the [Synchronization
Primitives](https://docs.python.org/3/library/asyncio-sync.html) had a timeout
parameter just like the [analogous
classes](https://docs.python.org/3/library/threading.html#condition-objects) do
in the threading module.
Thank you for your considerat
On Sun, Sep 19, 2021, 6:42 PM Andre Delfino wrote:
> Your code has an unpacking error in the first line. I think you mean this,
> right?
>
> no_items = object()
> item = no_items
>
> for item in get_items():
> frob(item)
>
> if item is no_items:
> raise ValueError()
>
Sorry yes. Actually
Your code has an unpacking error in the first line. I think you mean this,
right?
no_items = object()
item = no_items
for item in get_items():
frob(item)
if item is no_items:
raise ValueError()
___
Python-ideas mailing list -- python-ideas@pyt
Chris Angelico writes:
> Though factorials, in my experience, are far more commonly a
> demonstration of recursion than any sort of actual utility. I honestly
> cannot think of a single time when I've wanted to reach for a standard
> library factorial function.
I gather you've never accumulat