Typing issue with motor_asyncio types

XMLWordPrintableJSON

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

      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
              Reporter:
              Aldo Aguilar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: