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
+6 -1
View File
@@ -1,6 +1,7 @@
import random
import sys
from types import ModuleType
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias
import numpy
@@ -36,6 +37,10 @@ def create_random_state(random_state=None): ...
class PythonRandomViaNumpyBits(random.Random):
def __init__(self, rng: numpy.random.Generator | None = None) -> None: ...
if sys.version_info < (3, 10):
# this is a workaround for pyright correctly flagging an inconsistent inherited constructor, see #14624
def __new__(cls, rng: numpy.random.Generator | None = None) -> Self: ...
def getrandbits(self, k: int) -> int: ...
class PythonRandomInterface: