|
1 | 1 | import sys
|
2 |
| -import typing |
3 | 2 | from typing import Any, Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union, overload
|
4 | 3 |
|
5 | 4 | if sys.version_info < (3, 10):
|
6 | 5 | from _collections_abc import *
|
| 6 | +else: |
| 7 | + from typing import ( |
| 8 | + Callable, |
| 9 | + ItemsView, |
| 10 | + Iterable, |
| 11 | + Iterator, |
| 12 | + KeysView, |
| 13 | + Mapping, |
| 14 | + MutableMapping, |
| 15 | + MutableSequence, |
| 16 | + Reversible, |
| 17 | + Sequence, |
| 18 | + ValuesView, |
| 19 | + ) |
7 | 20 |
|
8 | 21 | _S = TypeVar("_S")
|
9 | 22 | _T = TypeVar("_T")
|
@@ -103,7 +116,7 @@ class UserString(Sequence[str]):
|
103 | 116 | def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
|
104 | 117 | def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...
|
105 | 118 | if sys.version_info >= (3, 8):
|
106 |
| - def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ... |
| 119 | + def encode(self: UserString, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ... |
107 | 120 | else:
|
108 | 121 | def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ...
|
109 | 122 | def endswith(self, suffix: Union[str, Tuple[str, ...]], start: Optional[int] = ..., end: Optional[int] = ...) -> bool: ...
|
@@ -281,9 +294,9 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
281 | 294 | def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ...
|
282 | 295 | @property
|
283 | 296 | def maps(self) -> List[Mapping[_KT, _VT]]: ...
|
284 |
| - def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... |
| 297 | + def new_child(self, m: Mapping[_KT, _VT] = ...) -> ChainMap[_KT, _VT]: ... |
285 | 298 | @property
|
286 |
| - def parents(self) -> typing.ChainMap[_KT, _VT]: ... |
| 299 | + def parents(self) -> ChainMap[_KT, _VT]: ... |
287 | 300 | def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
288 | 301 | def __delitem__(self, v: _KT) -> None: ...
|
289 | 302 | def __getitem__(self, k: _KT) -> _VT: ...
|
|
0 commit comments