|
1 | 1 | from _typeshed import SupportsWrite
|
2 | 2 | from reprlib import Repr
|
3 | 3 | from types import MethodType, ModuleType, TracebackType
|
4 |
| -from typing import IO, Any, AnyStr, Callable, Container, Mapping, MutableMapping, NoReturn, Optional |
| 4 | +from typing import IO, Any, AnyStr, Callable, Container, Mapping, MutableMapping, NoReturn, TypeVar |
5 | 5 |
|
6 | 6 | # the return type of sys.exc_info(), used by ErrorDuringImport.__init__
|
7 |
| -_Exc_Info = tuple[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]] |
| 7 | +_Exc_Info = tuple[type[BaseException] | None, BaseException | None, TracebackType | None] |
| 8 | + |
| 9 | +_T = TypeVar("_T") |
8 | 10 |
|
9 | 11 | __author__: str
|
10 | 12 | __date__: str
|
@@ -81,7 +83,7 @@ class HTMLDoc(Doc):
|
81 | 83 | ) -> str: ...
|
82 | 84 | def bigsection(self, title: str, *args: Any) -> str: ...
|
83 | 85 | def preformat(self, text: str) -> str: ...
|
84 |
| - def multicolumn(self, list: list[Any], format: Callable[[Any], str], cols: int = ...) -> str: ... |
| 86 | + def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = ...) -> str: ... |
85 | 87 | def grey(self, text: str) -> str: ...
|
86 | 88 | def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ...
|
87 | 89 | def classlink(self, object: object, modname: str) -> str: ...
|
@@ -211,7 +213,7 @@ class ModuleScanner:
|
211 | 213 | def run(
|
212 | 214 | self,
|
213 | 215 | callback: Callable[[str | None, str, str], None],
|
214 |
| - key: Any | None = ..., |
| 216 | + key: str | None = ..., |
215 | 217 | completer: Callable[[], None] | None = ...,
|
216 | 218 | onerror: Callable[[str], None] | None = ...,
|
217 | 219 | ) -> None: ...
|
|
0 commit comments