mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-02 05:16:53 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import importlib.abc
|
||||
import types
|
||||
import zipimport
|
||||
from _typeshed import Incomplete, Self
|
||||
from _typeshed import Incomplete
|
||||
from abc import ABCMeta
|
||||
from collections.abc import Callable, Generator, Iterable, Sequence
|
||||
from typing import IO, Any, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
_Version: TypeAlias = Incomplete # from packaging.version
|
||||
|
||||
@@ -55,7 +55,7 @@ class Environment:
|
||||
def remove(self, dist: Distribution) -> None: ...
|
||||
def can_add(self, dist: Distribution) -> bool: ...
|
||||
def __add__(self, other: Distribution | Environment) -> Environment: ...
|
||||
def __iadd__(self: Self, other: Distribution | Environment) -> Self: ...
|
||||
def __iadd__(self, other: Distribution | Environment) -> Self: ...
|
||||
@overload
|
||||
def best_match(self, req: Requirement, working_set: WorkingSet, *, replace_conflicting: bool = ...) -> Distribution: ...
|
||||
@overload
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user