More permissive type for random.choice and related functions (#6562)

This commit is contained in:
Jelle Zijlstra authored and GitHub committed 2021-12-10 19:50:02 +01:00
1 parent 74ecc2904b
commit 943dc5f61d
2 files changed
+12 -6

No files matched your search

+3 -2
View File
@@ -1,12 +1,13 @@
from _typeshed import SupportsLenAndGetItem
from hmac import compare_digest as compare_digest
from random import SystemRandom as SystemRandom
from typing import Sequence, TypeVar
from typing import TypeVar
_T = TypeVar("_T")
def randbelow(exclusive_upper_bound: int) -> int: ...
def randbits(k: int) -> int: ...
def choice(seq: Sequence[_T]) -> _T: ...
def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ...
def token_bytes(nbytes: int | None = ...) -> bytes: ...
def token_hex(nbytes: int | None = ...) -> str: ...
def token_urlsafe(nbytes: int | None = ...) -> str: ...