Skip to content

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

Closed
@blazewicz

Description

@blazewicz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions