dabeaz / curio

Good Curio!
Other
4.02k stars 241 forks source link

Potential Missing `await` Keyword and Typo in Docs #208

Closed CreatCodeBuild closed 7 years ago

CreatCodeBuild commented 7 years ago

In this page: http://curio.readthedocs.io/en/latest/devel.html#timeouts

The Timeouts section may have missed word.

result = ignore_after(seconds, coro)

and

if ignore_after(seconds, coro) == None:
    print('Timeout')

Do they miss the await?

Also, the doc states: __The ignore_after() function also works as a context-manager. When used in this way, a expired attribute is set to True when a timeout occurs. For example:__

async with ignore_after(seconds) as t:
    await coro1()
    await coro2()

if t.expired == None:
    print('Timeout')

But the code is comparing if t.expired == None.

Is this a typo?

dabeaz commented 7 years ago

Good catch! Fixed.