diff options
author | 2021-08-07 05:23:03 +0300 | |
---|---|---|
committer | 2021-08-31 13:08:51 -0700 | |
commit | 745cd1d6d3d6227d2a1e82cf25611d76221c40cd (patch) | |
tree | 6d653668fe1bbfd237b4c87890e0c67a36e2c7f5 /bot/utils/randomization.py | |
parent | Merge pull request #835 from python-discord/discord-2.0 (diff) |
Fix type annotations
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..3360ef44 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) -> None: 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: |