Motor 3.3.0 Released

Is there any documentation on how to use the type hints? This fails:

def mongo_client() -> AsyncIOMotorClient:  # <- Variable "motor.motor_asyncio.AsyncIOMotorClient" is not valid as a type  [valid-type]mypy(error)
    return AsyncIOMotorClient(os.environ["MONGO_URI"])

I can type it as a motor.core.AgnosticClient, but that just leads to other type errors.

2 Likes