Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions

View File

@@ -1,26 +1,26 @@
from _typeshed import Self
from re import Pattern
from typing_extensions import Self
class Version:
def __init__(self, vstring: str | None = ...) -> None: ...
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: ...
class StrictVersion(Version):
version_re: Pattern[str]
version: tuple[int, int, int]
prerelease: tuple[str, int] | None
def __init__(self, vstring: str | None = ...) -> None: ...
def parse(self: Self, vstring: str) -> Self: ...
def _cmp(self: Self, other: Self | str) -> bool: ...
def parse(self, vstring: str) -> Self: ...
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: ...
def parse(self: Self, vstring: str) -> Self: ...
def _cmp(self: Self, other: Self | str) -> bool: ...
def parse(self, vstring: str) -> Self: ...
def _cmp(self, other: Self | str) -> bool: ...

View File

@@ -1,7 +1,8 @@
from _typeshed import Incomplete, Self
from _typeshed import Incomplete
from collections.abc import Callable
from types import ModuleType
from typing import Any, Generic, TypeVar, overload
from typing_extensions import Self
from unittest import TestLoader, TestSuite
from setuptools import Command
@@ -16,7 +17,7 @@ class NonDataProperty(Generic[_T]):
fget: Callable[..., _T]
def __init__(self, fget: Callable[..., _T]) -> None: ...
@overload
def __get__(self: Self, obj: None, objtype: object = ...) -> Self: ...
def __get__(self, obj: None, objtype: object = ...) -> Self: ...
@overload
def __get__(self, obj: Any, objtype: object = ...) -> _T: ...