mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use _typeshed.Self in Python 2, too (#6932)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import Dict, List, Optional, Text, Tuple, TypeVar
|
||||
from _typeshed import Self, StrPath
|
||||
from typing import Dict, List, Optional, Text, Tuple
|
||||
|
||||
_P = TypeVar("_P")
|
||||
_Label = Tuple[int, Optional[Text]]
|
||||
_DFA = List[List[Tuple[int, int]]]
|
||||
_DFAS = Tuple[_DFA, Dict[int, int]]
|
||||
@@ -19,7 +18,7 @@ class Grammar:
|
||||
def __init__(self) -> None: ...
|
||||
def dump(self, filename: StrPath) -> None: ...
|
||||
def load(self, filename: StrPath) -> None: ...
|
||||
def copy(self: _P) -> _P: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
def report(self) -> None: ...
|
||||
|
||||
opmap_raw: Text
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union
|
||||
|
||||
@@ -21,7 +22,7 @@ class Base:
|
||||
was_checked: bool
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def _eq(self: _P, other: _P) -> bool: ...
|
||||
def clone(self: _P) -> _P: ...
|
||||
def clone(self: Self) -> Self: ...
|
||||
def post_order(self) -> Iterator[_NL]: ...
|
||||
def pre_order(self) -> Iterator[_NL]: ...
|
||||
def replace(self, new: _NL | List[_NL]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user