Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-1247

Typing issue with motor_asyncio types

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers

      When running python 3.11.5, mypy 0.981, and motor  3.3.2 i'm unable to use the AsyncIO- types defined in the motor_asyncio.py file. for example running mypy on this script will generate the following errors:

      motor-typing-script.py:3: error: Variable "motor.motor_asyncio.AsyncIOMotorClient" is not valid as a type  [valid-type]
      motor-typing-script.py:3: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases 
      from motor.motor_asyncio import AsyncIOMotorClient
      client: AsyncIOMotorClient = AsyncIOMotorClient("https://fakedburl.com", maxIdleTimeMS=1000)
       

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            aldo.aguilar@mongodb.com Aldo Aguilar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: