From 56e7aa6b488f2d5f183551182ee46b3e74596973 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Tue, 4 Apr 2017 12:59:25 -0400 Subject: [PATCH] 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 --- stdlib/2/copy.pyi | 10 ---------- stdlib/2and3/copy.pyi | 11 +++++++++++ stdlib/3/copy.pyi | 10 ---------- 3 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 stdlib/2/copy.pyi create mode 100644 stdlib/2and3/copy.pyi delete mode 100644 stdlib/3/copy.pyi diff --git a/stdlib/2/copy.pyi b/stdlib/2/copy.pyi deleted file mode 100644 index 0661cb7d4..000000000 --- a/stdlib/2/copy.pyi +++ /dev/null @@ -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: ... diff --git a/stdlib/2and3/copy.pyi b/stdlib/2and3/copy.pyi new file mode 100644 index 000000000..3f2635eb0 --- /dev/null +++ b/stdlib/2and3/copy.pyi @@ -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 diff --git a/stdlib/3/copy.pyi b/stdlib/3/copy.pyi deleted file mode 100644 index 0661cb7d4..000000000 --- a/stdlib/3/copy.pyi +++ /dev/null @@ -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: ...