File tree 2 files changed +0
-27
lines changed 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:
111
111
2 . Use forward references in the type annotations (e.g. ` def methodname(self, param1: 'othermodule.OtherClass'): ` )
112
112
113
113
On 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 = [
56
56
" sphobjinv>=2.3.1" ,
57
57
" typing-extensions>=4.6.3" ,
58
58
]
59
- optional-dependencies.type-comment = [
60
- ' typed-ast>=1.5.4; python_version < "3.8"' ,
61
- ]
62
59
urls.Changelog = " https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
63
60
urls.Homepage = " https://github.com/tox-dev/sphinx-autodoc-typehints"
64
61
urls.Source = " https://github.com/tox-dev/sphinx-autodoc-typehints"
You can’t perform that action at this time.
0 commit comments