diff options
| author | Taku Fukada <naninunenor@gmail.com> | 2020-07-24 03:22:41 +0900 |
|---|---|---|
| committer | Taku Fukada <naninunenor@gmail.com> | 2020-07-24 18:20:03 +0900 |
| commit | 54a342a7f5b74f32c7a53ea483d9046e688b9830 (patch) | |
| tree | cbffe76818a71ffa52a8b7151baed21c0b387c5b /shared-bindings/random | |
| parent | 543708416bc19bc1e77d859d013c4757433ad255 (diff) | |
Add and correct some type hints
Diffstat (limited to 'shared-bindings/random')
| -rw-r--r-- | shared-bindings/random/__init__.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index 10ddca499..35756eef1 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -46,6 +46,9 @@ //| .. warning:: Numbers from this module are not cryptographically strong! Use //| bytes from `os.urandom` directly for true randomness.""" //| +//| from typing import TypeVar +//| _T = TypeVar('_T') +//| //| def seed(seed: int) -> None: //| """Sets the starting seed of the random number generation. Further calls to @@ -129,7 +132,7 @@ STATIC mp_obj_t random_randint(mp_obj_t a_in, mp_obj_t b_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(random_randint_obj, random_randint); -//| def choice(seq: list) -> Any: +//| def choice(seq: Sequence[_T]) -> _T: //| """Returns a randomly selected element from the given sequence. Raises //| IndexError when the sequence is empty.""" //| ... |
