mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-15 07:36:45 +08:00
Python3.8 additions and changes (#3337)
* Add as_integer_ratio() to a few types * Add dirs_exist_ok to copytree() * int, float, complex accept __index__ args Also fix complex.__init__ argument names * Add __reversed__ to dict et al. * Python 3.8 date(time) arithmetic fixes * Add CodeType.replace()
This commit is contained in:
committed by
Jelle Zijlstra
parent
d0beab9b8e
commit
8a7d61741d
@@ -72,6 +72,27 @@ class CodeType:
|
||||
freevars: Tuple[str, ...] = ...,
|
||||
cellvars: Tuple[str, ...] = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def replace(
|
||||
self,
|
||||
*,
|
||||
co_argcount: int = ...,
|
||||
co_posonlyargcount: int = ...,
|
||||
co_kwonlyargcount: int = ...,
|
||||
co_nlocals: int = ...,
|
||||
co_stacksize: int = ...,
|
||||
co_flags: int = ...,
|
||||
co_firstlineno: int = ...,
|
||||
co_code: bytes = ...,
|
||||
co_consts: Tuple[Any, ...] = ...,
|
||||
co_names: Tuple[str, ...] = ...,
|
||||
co_varnames: Tuple[str, ...] = ...,
|
||||
co_freevars: Tuple[str, ...] = ...,
|
||||
co_cellvars: Tuple[str, ...] = ...,
|
||||
co_filename: str = ...,
|
||||
co_name: str = ...,
|
||||
co_lnotab: bytes = ...,
|
||||
) -> CodeType: ...
|
||||
|
||||
class MappingProxyType(Mapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ...
|
||||
|
||||
@@ -339,6 +339,8 @@ class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co,
|
||||
def __rand__(self, o: Iterable[_T]) -> Set[_T]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reversed__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...
|
||||
def __or__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ...
|
||||
def __ror__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ...
|
||||
def __sub__(self, o: Iterable[Any]) -> Set[Tuple[_KT_co, _VT_co]]: ...
|
||||
@@ -351,6 +353,8 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
|
||||
def __rand__(self, o: Iterable[_T]) -> Set[_T]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_KT_co]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reversed__(self) -> Iterator[_KT_co]: ...
|
||||
def __or__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ...
|
||||
def __ror__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ...
|
||||
def __sub__(self, o: Iterable[Any]) -> Set[_KT_co]: ...
|
||||
@@ -361,6 +365,8 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
|
||||
class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_VT_co]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reversed__(self) -> Iterator[_VT_co]: ...
|
||||
|
||||
@runtime_checkable
|
||||
class ContextManager(Protocol[_T_co]):
|
||||
|
||||
Reference in New Issue
Block a user