sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.45k stars 2.1k forks source link

Resolve a `mypy --strict` `comparison-overlap` error #12884

Closed adamtheturtle closed 1 week ago

adamtheturtle commented 2 weeks ago

Without this, mypy --strict sphinx/ gives:

sphinx/ext/apidoc.py: note: In function "is_packagedir":
sphinx/ext/apidoc.py:72:8: error: Non-overlapping identity check (left operand type: "list[str] | None", right operand type: "str | None")  [comparison-overlap]
adamtheturtle commented 1 week ago

@jayaddison I chose this one as it was trivial. I'm not speaking to all of them, but some comparison-overlap errors are not so trivial.