Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible typehints for Sphinx and mypy #2

Open
fjarri opened this issue Mar 11, 2021 · 0 comments
Open

Incompatible typehints for Sphinx and mypy #2

fjarri opened this issue Mar 11, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@fjarri
Copy link
Owner

fjarri commented Mar 11, 2021

Currently, for mypy 0.770, sphinx 3.5.2, their requirements for typehints are contradictory.

In order for typehints to hyperlink properly in the docs, sphinx needs from __future__ import annotations and, in some cases, fully qualified type names (with all the outer namespaces present).

On the other hand, mypy does not need the __future__ import (and, in fact, not having it adds a compile-time check that the types are available), and does not handle fully qualified type names correctly.

The current choice is to side with Sphinx since the documentation is more important. Perhaps it will be resolved in future versions (e.g. Sphinx 4.0).

@fjarri fjarri added the documentation Improvements or additions to documentation label Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant