mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,36 +1,36 @@
|
||||
from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from re import Pattern
|
||||
from typing_extensions import Self
|
||||
|
||||
class Version:
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __lt__(self: Self, other: Self | str) -> bool: ...
|
||||
def __le__(self: Self, other: Self | str) -> bool: ...
|
||||
def __gt__(self: Self, other: Self | str) -> bool: ...
|
||||
def __ge__(self: Self, other: Self | str) -> bool: ...
|
||||
def __lt__(self, other: Self | str) -> bool: ...
|
||||
def __le__(self, other: Self | str) -> bool: ...
|
||||
def __gt__(self, other: Self | str) -> bool: ...
|
||||
def __ge__(self, other: Self | str) -> bool: ...
|
||||
@abstractmethod
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
@abstractmethod
|
||||
def parse(self: Self, vstring: str) -> Self: ...
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
@abstractmethod
|
||||
def __str__(self) -> str: ...
|
||||
@abstractmethod
|
||||
def _cmp(self: Self, other: Self | str) -> bool: ...
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
|
||||
class StrictVersion(Version):
|
||||
version_re: Pattern[str]
|
||||
version: tuple[int, int, int]
|
||||
prerelease: tuple[str, int] | None
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
def parse(self: Self, vstring: str) -> Self: ...
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def _cmp(self: Self, other: Self | str) -> bool: ...
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: tuple[str | int, ...]
|
||||
def __init__(self, vstring: str | None = None) -> None: ...
|
||||
def parse(self: Self, vstring: str) -> Self: ...
|
||||
def parse(self, vstring: str) -> Self: ...
|
||||
def __str__(self) -> str: ... # noqa: Y029
|
||||
def _cmp(self: Self, other: Self | str) -> bool: ...
|
||||
def _cmp(self, other: Self | str) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user