Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support coroutines with async and await syntax #17

Merged
merged 2 commits into from
Dec 18, 2015

Commits on Dec 17, 2015

  1. Configuration menu
    Copy the full SHA
    864a434 View commit details
    Browse the repository at this point in the history
  2. Support coroutines with async and await syntax

    PEP 492 added support for defining coroutines using `async def` rather
    than having to decorate the function with `@asyncio.coroutine`. The new
    `_is_coroutine` function will match any coroutines created with the
    decorator using `inspect.isgeneratorfunction` as well as those created
    through the async and await syntax using `asyncio.iscoroutinefunction`.
    
    The tests for this need to be added in an unconventional way. `async`
    and `await` cause syntax errors in versions of Python prior to 3.5.
    Rather than causing the tests for 3.3 and 3.4 to fail, the tests are
    being defined as a string and then compiled and executed into the
    module. If a time ever comes that this library no longer supports
    versions prior to 3.5, this new module can be removed entirely.
    dirn committed Dec 17, 2015
    Configuration menu
    Copy the full SHA
    a4afe36 View commit details
    Browse the repository at this point in the history