diff options
author | 2021-09-03 00:31:12 -0700 | |
---|---|---|
committer | 2021-09-03 00:31:12 -0700 | |
commit | ea47bc617e558929bcee39e6008a57d6dd814aa1 (patch) | |
tree | c40e2f23e55119fb33f83271d227103cb9be7c6f /bot/utils/randomization.py | |
parent | Improved consistency for codeblocks to end with a newline (diff) | |
parent | Merge pull request #802 from python-discord/decorator-factory/typehints-fix (diff) |
Merge branch 'main' into android-codeblock-fix
Diffstat (limited to 'bot/utils/randomization.py')
-rw-r--r-- | bot/utils/randomization.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/utils/randomization.py b/bot/utils/randomization.py index 8f47679a..c9eabbd2 100644 --- a/bot/utils/randomization.py +++ b/bot/utils/randomization.py @@ -1,6 +1,7 @@ import itertools import random -import typing as t +from collections.abc import Iterable +from typing import Any class RandomCycle: @@ -10,11 +11,11 @@ class RandomCycle: The iterable is reshuffled after each full cycle. """ - def __init__(self, iterable: t.Iterable) -> None: + def __init__(self, iterable: Iterable): self.iterable = list(iterable) self.index = itertools.cycle(range(len(iterable))) - def __next__(self) -> t.Any: + def __next__(self) -> Any: idx = next(self.index) if idx == 0: |