From 613840ebcf303e84048d48ace37fb001c1afe687 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 6 May 2023 16:12:32 +0100 Subject: Apply fixes for ruff linting Co-authored-by: wookie184 Co-authored-by: Amrou Bellalouna --- bot/exts/utilities/wtf_python.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bot/exts/utilities/wtf_python.py') diff --git a/bot/exts/utilities/wtf_python.py b/bot/exts/utilities/wtf_python.py index 0c0375cb..29a9611c 100644 --- a/bot/exts/utilities/wtf_python.py +++ b/bot/exts/utilities/wtf_python.py @@ -1,7 +1,6 @@ import logging import random import re -from typing import Optional import rapidfuzz from discord import Embed, File @@ -67,7 +66,7 @@ class WTFPython(commands.Cog): hyper_link = match[0].split("(")[1].replace(")", "") self.headers[match[0]] = f"{BASE_URL}/{hyper_link}" - def fuzzy_match_header(self, query: str) -> Optional[str]: + def fuzzy_match_header(self, query: str) -> str | None: """ Returns the fuzzy match of a query if its ratio is above "MINIMUM_CERTAINTY" else returns None. @@ -79,7 +78,7 @@ class WTFPython(commands.Cog): return match if certainty > MINIMUM_CERTAINTY else None @commands.command(aliases=("wtf",)) - async def wtf_python(self, ctx: commands.Context, *, query: Optional[str] = None) -> None: + async def wtf_python(self, ctx: commands.Context, *, query: str | None = None) -> None: """ Search WTF Python repository. -- cgit v1.2.3