From 7da74a6c833b081435724b3be1eaaeac70166a83 Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Sat, 6 Jan 2024 19:00:25 +0300 Subject: [PATCH] refactor: float matches integers too --- discord/rate_limiting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/discord/rate_limiting.py b/discord/rate_limiting.py index d1fe0368f6..d80552fde3 100644 --- a/discord/rate_limiting.py +++ b/discord/rate_limiting.py @@ -45,7 +45,7 @@ class GlobalRateLimit: ---------- concurrency: :class:`int` The concurrency to reset every `per` seconds. - per: :class:`int` | :class:`float` + per: :class:`float` Number of seconds to wait until resetting `concurrency`. remaining: :class:`int` Number of available requests remaining. If the value of remaining @@ -57,21 +57,21 @@ class GlobalRateLimit: The current concurrency. pending_reset: :class:`bool` The class is pending a reset of `concurrency`. - reset_at :class:`int` | :class:`float` | `None` + reset_at Optional[:class:`float`] Unix timestamp of when this class will next reset. """ def __init__( - self, concurrency: int, per: float | int, remaining: int = MISSING + self, concurrency: int, per: float, remaining: int = MISSING ) -> None: self.concurrency: int = concurrency - self.per: float | int = per + self.per: float = per self.current: int = self.concurrency self._processing: list[asyncio.Future] = [] self.loop: asyncio.AbstractEventLoop | None = None self.pending_reset: bool = False - self.reset_at: int | float | None = None + self.reset_at: float | None = None if remaining is not MISSING: raise ValueError(