Use typing_extensions.Self in the stdlib (#9694)

This commit is contained in:
Alex Waygood
2023-02-09 09:12:13 +00:00
committed by GitHub
parent 10086c06a1
commit 9ed39d8796
98 changed files with 627 additions and 654 deletions

View File

@@ -1,7 +1,7 @@
import abc
import pathlib
import sys
from _typeshed import Self, StrPath
from _typeshed import StrPath
from collections.abc import Iterable, Mapping
from email.message import Message
from importlib.abc import MetaPathFinder
@@ -9,6 +9,7 @@ from os import PathLike
from pathlib import Path
from re import Pattern
from typing import Any, ClassVar, NamedTuple, overload
from typing_extensions import Self
__all__ = [
"Distribution",
@@ -86,13 +87,13 @@ if sys.version_info >= (3, 10):
class SelectableGroups(dict[str, EntryPoints]): # use as dict is deprecated since 3.10
@classmethod
def load(cls: type[Self], eps: Iterable[EntryPoint]) -> Self: ...
def load(cls, eps: Iterable[EntryPoint]) -> Self: ...
@property
def groups(self) -> set[str]: ...
@property
def names(self) -> set[str]: ...
@overload
def select(self: Self) -> Self: ... # type: ignore[misc]
def select(self) -> Self: ... # type: ignore[misc]
@overload
def select(
self,