mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
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:
committed by
Jelle Zijlstra
parent
3594b0e607
commit
56e7aa6b48
@@ -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
11
stdlib/2and3/copy.pyi
Normal 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
|
||||
@@ -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: ...
|
||||
Reference in New Issue
Block a user