fix up some C signatures (#14624)

a few issues exposed after https://github.com/python/mypy/pull/18259 was merged
This commit is contained in:
Stephen Morton
2025-08-22 06:58:55 -07:00
committed by GitHub
parent b7f7335f82
commit cc14cc6c2a
6 changed files with 122 additions and 45 deletions
+7 -2
View File
@@ -1,10 +1,15 @@
from typing_extensions import TypeAlias
import sys
from typing_extensions import Self, TypeAlias
# Actually Tuple[(int,) * 625]
_State: TypeAlias = tuple[int, ...]
class Random:
def __init__(self, seed: object = ...) -> None: ...
if sys.version_info >= (3, 10):
def __init__(self, seed: object = ..., /) -> None: ...
else:
def __new__(self, seed: object = ..., /) -> Self: ...
def seed(self, n: object = None, /) -> None: ...
def getstate(self) -> _State: ...
def setstate(self, state: _State, /) -> None: ...