|
6 | 6 | import sys
|
7 | 7 | from typing import (
|
8 | 8 | Any, Awaitable, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar,
|
9 |
| - Union, overload, Type |
| 9 | + Union, overload, Type, Iterable |
10 | 10 | )
|
11 | 11 |
|
12 | 12 | # ModuleType is exported from this module, but for circular import
|
@@ -156,6 +156,38 @@ class BuiltinFunctionType:
|
156 | 156 | def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
157 | 157 | BuiltinMethodType = BuiltinFunctionType
|
158 | 158 |
|
| 159 | +if sys.version_info >= (3, 7): |
| 160 | + class WrapperDescriptorType: |
| 161 | + __name__: str |
| 162 | + __qualname__: str |
| 163 | + __objclass__: type |
| 164 | + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... |
| 165 | + def __get__(self, obj: Any, type: type = ...) -> Any: ... |
| 166 | + |
| 167 | + class MethodWrapperType: |
| 168 | + __self__: object |
| 169 | + __name__: str |
| 170 | + __qualname__: str |
| 171 | + __objclass__: type |
| 172 | + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... |
| 173 | + def __eq__(self, other: Any) -> bool: ... |
| 174 | + def __ne__(self, other: Any) -> bool: ... |
| 175 | + |
| 176 | + class MethodDescriptorType: |
| 177 | + __name__: str |
| 178 | + __qualname__: str |
| 179 | + __objclass__: type |
| 180 | + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... |
| 181 | + def __get__(self, obj: Any, type: type = ...) -> Any: ... |
| 182 | + |
| 183 | + class ClassMethodDescriptorType: |
| 184 | + __name__: str |
| 185 | + __qualname__: str |
| 186 | + __objclass__: type |
| 187 | + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... |
| 188 | + def __get__(self, obj: Any, type: type = ...) -> Any: ... |
| 189 | + |
| 190 | + |
159 | 191 | class TracebackType:
|
160 | 192 | if sys.version_info >= (3, 7):
|
161 | 193 | def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ...
|
@@ -199,7 +231,11 @@ class MemberDescriptorType:
|
199 | 231 | def __set__(self, obj: Any) -> None: ...
|
200 | 232 | def __delete__(self, obj: Any) -> None: ...
|
201 | 233 |
|
202 |
| -def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... |
| 234 | +if sys.version_info >= (3, 7): |
| 235 | + def new_class(name: str, bases: Iterable[object] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... |
| 236 | + def resolve_bases(bases: Iterable[object]) -> Tuple[Any, ...]: ... |
| 237 | +else: |
| 238 | + def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... |
203 | 239 | def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ...
|
204 | 240 |
|
205 | 241 | # Actually a different type, but `property` is special and we want that too.
|
|
0 commit comments