Skip to content

Commit

Permalink
Copyreg stubs (#3387)
Browse files Browse the repository at this point in the history
  • Loading branch information
CraftSpider authored and JelleZijlstra committed Oct 30, 2019
1 parent b5b9a39 commit b112c20
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions stdlib/2/copy_reg.pyi
@@ -0,0 +1,14 @@

from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List


_Type = TypeVar("_Type", bound=type)
_Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]]

__all__: List[str]

def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ...
def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ...
def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ...
def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ...
def clear_extension_cache() -> None: ...
14 changes: 14 additions & 0 deletions stdlib/3/copyreg.pyi
@@ -0,0 +1,14 @@

from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List


_Type = TypeVar("_Type", bound=type)
_Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]]

__all__: List[str]

def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ...
def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ...
def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ...
def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ...
def clear_extension_cache() -> None: ...
1 change: 1 addition & 0 deletions tests/check_consistent.py
Expand Up @@ -27,6 +27,7 @@
{'stdlib/3/pathlib.pyi', 'third_party/2/pathlib2.pyi'},
{'stdlib/3.7/contextvars.pyi', 'third_party/3/contextvars.pyi'},
{'stdlib/3/ipaddress.pyi', 'third_party/2/ipaddress.pyi'},
{'stdlib/2/copy_reg.pyi', 'stdlib/3/copyreg.pyi'},
]

def main():
Expand Down

0 comments on commit b112c20

Please sign in to comment.