We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Python 3 supports optional type annotations using the typing module.
Benefits of specifying type annotations:
nimi-python already documents types in docstrings, so the information is already there. It would only need to be output in a different format.
The text was updated successfully, but these errors were encountered:
I prefer to wait until we drop Python 3.8, before adding type hints, due to the major differences in how collections are annotated between 3.8 and 3.9: https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html#useful-built-in-types
Sorry, something went wrong.
The collection types are really not a big deal. They don't even require the typing_extensions package.
typing_extensions
For now, use from typing import List and write List[T]. When you drop Python 3.8, then use pyupgrade to rewrite any hand-written type hints: https://github.com/asottile/pyupgrade#pep-585-typing-rewrites
from typing import List
List[T]
Using other new typing features in old Python versions is also possible, but it requires a little more work:
if typing.TYPE_CHECKING: if sys.version_info >= (3, 11): from typing import Self else: from typing_extensions import Self class Session: def __enter__(self) -> Self: ...
No branches or pull requests
Python 3 supports optional type annotations using the typing module.
Benefits of specifying type annotations:
nimi-python already documents types in docstrings, so the information is already there. It would only need to be output in a different format.
The text was updated successfully, but these errors were encountered: