8000 Merge pull request #6299 from tekktrik/doc/fix-randrange · tannewt/circuitpython@4f31f1d · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f31f1d

Browse files
authored
Merge pull request micropython#6299 from tekktrik/doc/fix-randran 8000 ge
Fix signature of random.randrange() to show multiple signatures in stub
2 parents a4ccdd1 + cad8750 commit 4f31f1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shared-bindings/random/__init__.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) {
7575
}
7676
STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits);
7777

78-
//| def randrange(stop: Tuple[int, int, int]) -> int:
79-
//| """Returns a randomly selected integer from ``range(start, stop, step)``."""
78+
//| @overload
79+
//| def randrange(stop: int) -> int: ...
80+
//| @overload
81+
//| def randrange(start: int, stop: int) -> int: ...
82+
//| @overload
83+
//| def randrange(start: int, stop: int, step: int) -> int:
84+
//| """Returns a randomly selected integer from ``range(start[, stop[, step]])``."""
8085
//| ...
8186
//|
8287
STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) {

0 commit comments

Comments
 (0)
0