Improve a bunch of __(deep)copy__ methods (#7148)

This commit is contained in:
Alex Waygood
2022-02-06 23:40:44 +00:00
committed by GitHub
parent a62fd92fb0
commit 494481a0ae
6 changed files with 13 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
from _typeshed import Self
from collections.abc import Mapping
from typing import Any
class _TokenType(tuple[str, ...]):
parent: _TokenType | None
@@ -6,8 +8,8 @@ class _TokenType(tuple[str, ...]):
subtypes: set[_TokenType]
def __contains__(self, val: _TokenType) -> bool: ... # type: ignore[override]
def __getattr__(self, name: str) -> _TokenType: ...
def __copy__(self): ...
def __deepcopy__(self, memo): ...
def __copy__(self: Self) -> Self: ...
def __deepcopy__(self: Self, memo: Any) -> Self: ...
Token: _TokenType
Text: _TokenType