Simplify, fix, and merge copy module (#1132)

* Simplify and add missing types for copy module.

Error and error were missing.  I also removed the internal arg memo.

* Move copy module into 2and3

* Bring back internal kwargs
This commit is contained in:
David Euresti
2017-04-04 12:59:25 -04:00
committed by Jelle Zijlstra
parent 3594b0e607
commit 56e7aa6b48
3 changed files with 11 additions and 20 deletions

View File

@@ -1,10 +0,0 @@
# Stubs for copy
# NOTE: These are incomplete!
from typing import TypeVar, Dict, Any
_T = TypeVar('_T')
def deepcopy(x: _T, memo: Dict[Any, Any] = ...) -> _T: ...
def copy(x: _T) -> _T: ...

11
stdlib/2and3/copy.pyi Normal file
View File

@@ -0,0 +1,11 @@
# Stubs for copy
from typing import TypeVar, Optional, Dict, Any
_T = TypeVar('_T')
# Note: memo and _nil are internal kwargs.
def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ...
def copy(x: _T) -> _T: ...
class Error(Exception): ...
error = Error

View File

@@ -1,10 +0,0 @@
# Stubs for copy
# NOTE: These are incomplete!
from typing import TypeVar, Dict, Any
_T = TypeVar('_T')
def deepcopy(x: _T, memo: Dict[Any, Any] = ...) -> _T: ...
def copy(x: _T) -> _T: ...