X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/b3ceb293d9e69295a190fed93517cbe1b7372154..1d7163957a34e8f071aaf9ac59467b912449fb07:/src/blib2to3/pytree.py?ds=inline diff --git a/src/blib2to3/pytree.py b/src/blib2to3/pytree.py index 0c074f6..001652d 100644 --- a/src/blib2to3/pytree.py +++ b/src/blib2to3/pytree.py @@ -33,7 +33,7 @@ __author__ = "Guido van Rossum " import sys from io import StringIO -HUGE: int = 0x7fffffff # maximum repeat count, default max +HUGE: int = 0x7FFFFFFF # maximum repeat count, default max _type_reprs: Dict[int, Union[Text, int]] = {} @@ -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.