Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4225

Type Hints in Stub Files: Convert Optional[d] to d | None

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      We are not using the modern annotation recommended in PEP 604. Ruff format even has a rule and autofix for this. https://docs.astral.sh/ruff/rules/non-pep604-annotation/

      Definition of done

      We applied it once based on the recommendation from an external contributor. Now we can apply throughout. Make sure all unit tests, and mypy tests, pass.

      What should the implementer watch out for? What are the risks?
      None

            Assignee:
            Unassigned Unassigned
            Reporter:
            casey.clements@mongodb.com Casey Clements
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: