graphql-python / graphql-core

A Python 3.6+ port of the GraphQL.js reference implementation of GraphQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use `inspect.isawaitable` instead of custom `is_awaitable` helper function

bartenra opened this issue · comments

Since Python 3.5 there's an inspect.isawaitable function.

I believe the is_awaitable function in the code base should be removed. Instead, the function part of the standard library should be used.

I was having issues because I was using __getattr__ in a class and is_awaitable helper uses hasattr(value, "__await__"), resulting in a false positive.

OK I just found this thread: #54