Use _typeshed.Self in docutils.VersionInfo and os.sched_param (#7117)

This commit is contained in:
Alex Waygood
2022-02-02 22:30:39 +00:00
committed by GitHub
parent 0ccbc29919
commit 26e8959279
2 changed files with 10 additions and 3 deletions

View File

@@ -953,7 +953,7 @@ else:
if sys.platform != "win32":
@final
class sched_param(structseq[int], tuple[int]):
def __new__(cls, sched_priority: int) -> sched_param: ...
def __new__(cls: type[Self], sched_priority: int) -> Self: ...
@property
def sched_priority(self) -> int: ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Self
from typing import Any, ClassVar, NamedTuple
__docformat__: str
@@ -13,8 +14,14 @@ class _VersionInfo(NamedTuple):
class VersionInfo(_VersionInfo):
def __new__(
cls, major: int = ..., minor: int = ..., micro: int = ..., releaselevel: str = ..., serial: int = ..., release: bool = ...
) -> VersionInfo: ...
cls: type[Self],
major: int = ...,
minor: int = ...,
micro: int = ...,
releaselevel: str = ...,
serial: int = ...,
release: bool = ...,
) -> Self: ...
__version_info__: VersionInfo
__version_details__: str