X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/773e4a22d58be1f1aa82df7ad9a0f4c4e1328c10..1d7163957a34e8f071aaf9ac59467b912449fb07:/src/blib2to3/pytree.py diff --git a/src/blib2to3/pytree.py b/src/blib2to3/pytree.py index 7843467..001652d 100644 --- a/src/blib2to3/pytree.py +++ b/src/blib2to3/pytree.py @@ -52,7 +52,7 @@ def type_repr(type_num: int) -> Union[Text, int]: return _type_reprs.setdefault(type_num, type_num) -_P = TypeVar("_P") +_P = TypeVar("_P", bound="Base") NL = Union["Node", "Leaf"] Context = Tuple[Text, Tuple[int, int]] @@ -109,6 +109,9 @@ class Base(object): """ raise NotImplementedError + def __deepcopy__(self: _P, memo: Any) -> _P: + return self.clone() + def clone(self: _P) -> _P: """ Return a cloned (deep) copy of self.