mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-02 14:10:23 +08:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user