From 5f98dbb4bf3c52135498e7b0853618d032e0a281 Mon Sep 17 00:00:00 2001 From: Cadel Watson Date: Tue, 3 Jan 2017 14:15:09 +1100 Subject: [PATCH] Create stubs for the secrets module in Python 3.6 --- stdlib/3.6/secrets.pyi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 stdlib/3.6/secrets.pyi diff --git a/stdlib/3.6/secrets.pyi b/stdlib/3.6/secrets.pyi new file mode 100644 index 000000000..bff4716c3 --- /dev/null +++ b/stdlib/3.6/secrets.pyi @@ -0,0 +1,14 @@ +# Stubs for secrets (Python 3.6) + +from typing import Optional, Sequence, TypeVar +from hmac import compare_digest as compare_digest +from random import SystemRandom as SystemRandom + +_T = TypeVar('_T') + +def randbelow(exclusive_upper_bound: int) -> int: ... +def randbits(k: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def token_bytes(nbytes: Optional[int]) -> bytes: ... +def token_hex(nbytes: Optional[int]) -> str: ... +def token_urlsafe(nbytes: Optional[int]) -> str: ...