File tree Expand file tree Collapse file tree 2 files changed +0
-27
lines changed Expand file tree Collapse file tree 2 files changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -111,27 +111,3 @@ creates a circular import problem. The solution to this is the following:
1111112 . Use forward references in the type annotations (e.g. ` def methodname(self, param1: 'othermodule.OtherClass'): ` )
112112
113113On Python 3.7, you can even use ` from __future__ import annotations ` and remove the quotes.
114-
115- ## Using type hint comments
116-
117- If you\' re documenting code that needs to stay compatible with Python 2.7, you cannot use regular type annotations.
118- Instead, you must either be using Python 3.8 or later or have [ typed_ast] ( https://pypi.org/project/typed-ast/ )
119- installed. The package extras ` type_comments ` will pull in the appropriate dependencies automatically. Then you can add
120- type hint comments in the following manner:
121-
122- ``` python
123- def myfunction (arg1 , arg2 ):
124- # type: ( int , str ) -> int
125- return 42
126- ```
127-
128- or alternatively:
129-
130- ``` python
131- def myfunction (
132- arg1 , # type: int
133- arg2 , # type: str
134- ):
135- # type: (...) -> int
136- return 42
137- ```
Original file line number Diff line number Diff line change @@ -56,9 +56,6 @@ optional-dependencies.testing = [
5656 " sphobjinv>=2.3.1" ,
5757 " typing-extensions>=4.6.3" ,
5858]
59- optional-dependencies.type-comment = [
60- ' typed-ast>=1.5.4; python_version < "3.8"' ,
61- ]
6259urls.Changelog = " https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
6360urls.Homepage = " https://github.com/tox-dev/sphinx-autodoc-typehints"
6461urls.Source = " https://github.com/tox-dev/sphinx-autodoc-typehints"
You can’t perform that action at this time.
0 commit comments