X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/7d032fa848c8910007a0a41c1ba61d70d2846f48..1d7260050d846d2ba2dd5bb22944b032245c7e51:/src/blib2to3/pytree.py diff --git a/src/blib2to3/pytree.py b/src/blib2to3/pytree.py index 6dba3c7..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 @@ -34,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]] = {} @@ -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.