X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2082a325fdd14f0aabd88f7f12a20f9fb085c538..d7b091e762121ee38ca313ab25006abf4723d203:/src/blib2to3/pytree.py?ds=sidebyside diff --git a/src/blib2to3/pytree.py b/src/blib2to3/pytree.py index 4b841b7..001652d 100644 --- a/src/blib2to3/pytree.py +++ b/src/blib2to3/pytree.py @@ -25,7 +25,6 @@ from typing import ( Union, Set, Iterable, - Sequence, ) from blib2to3.pgen2.grammar import Grammar @@ -53,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]] @@ -110,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.