Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Commit 69a64ef

Browse files
committed
fixup! Add generate framework
1 parent c310d46 commit 69a64ef

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

generate/random.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def choice(return_type: str, ty: str, size: bool) -> Func:
227227
functions += list(distribution("rayleigh", "float", Arg("scale", "float")))
228228
functions += [
229229
Func(
230-
"seed", "None", [SELF, Arg("seed", "Union[None, int, ndarray]", True)]
230+
"seed", "None", [SELF, Arg("seed", "Union[None, int, Tuple[int], List[int]]", True)]
231231
),
232232
Func(
233233
"set_state",
@@ -273,8 +273,9 @@ def choice(return_type: str, ty: str, size: bool) -> Func:
273273

274274
prelude = """\
275275
import builtins
276-
from typing import Any, overload, Optional, Sequence, Tuple, TypeVar, Union
277-
276+
from typing import (
277+
Any, List, overload, Optional, Sequence, Tuple, TypeVar, Union
278+
)
278279
from numpy import ndarray
279280
280281
_Size = Union[int, Sequence[int]]
@@ -289,7 +290,7 @@ def choice(return_type: str, ty: str, size: bool) -> Func:
289290
"""
290291
class RandomState:
291292
def __init__(
292-
self, state: Optional[Union[int, ndarray]] = ...
293+
self, state: Union[None, int, List[int], Tuple[int]] = ...
293294
) -> None: ...
294295
"""
295296
)

0 commit comments

Comments
 (0)