graphql-python / graphql-core-legacy

GraphQL base implementation for Python (legacy version – see graphql-core for the current one)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mypy errors with AsyncioExecutor(loop=asyncio.get_event_loop())

blazewicz opened this issue · comments

With current version of mypy any project using AsyncioExecutor with loop= argument provided as follows:

executor = AsyncioExecutor(loop=asyncio.get_event_loop())

fails type check with following error

***: error: Argument "loop" to "AsyncioExecutor" has incompatible type "AbstractEventLoop"; expected "Optional[_UnixSelectorEventLoop]"

Basically asyncio.get_event_loop() returns asyncio.AbstractEventLoop object, and AsyncioExecutor expects asyncio._UnixSelectorEventLoop.

type definition:

# type: (Optional[_UnixSelectorEventLoop]) -> None