From 177502efe86d117476566172f29fb699c19a68a2 Mon Sep 17 00:00:00 2001 From: No767 <73260931+No767@users.noreply.github.com> Date: Sat, 30 Dec 2023 01:43:31 -0800 Subject: [PATCH] Use type checking and future imports for parity --- bot/cogs/dev_tools.py | 8 ++++++-- bot/cogs/utilities.py | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bot/cogs/dev_tools.py b/bot/cogs/dev_tools.py index 45f000b..dd4be8f 100644 --- a/bot/cogs/dev_tools.py +++ b/bot/cogs/dev_tools.py @@ -1,11 +1,15 @@ -from typing import Literal, Optional +from __future__ import annotations + +from typing import TYPE_CHECKING, Literal, Optional import discord from cogs import EXTENSIONS from discord.ext import commands from discord.ext.commands import Context, Greedy from libs.utils import RoboContext, RoboView -from rodhaj import Rodhaj + +if TYPE_CHECKING: + from bot.rodhaj import Rodhaj class MaybeView(RoboView): diff --git a/bot/cogs/utilities.py b/bot/cogs/utilities.py index a41c807..e0211a1 100644 --- a/bot/cogs/utilities.py +++ b/bot/cogs/utilities.py @@ -1,6 +1,9 @@ +from __future__ import annotations + import datetime import itertools import platform +from typing import TYPE_CHECKING import discord import psutil @@ -8,7 +11,9 @@ from discord.ext import commands from discord.utils import format_dt from libs.utils import Embed, RoboContext, human_timedelta -from rodhaj import Rodhaj + +if TYPE_CHECKING: + from bot.rodhaj import Rodhaj # A cog houses a category of commands