replace option with |None

This commit is contained in:
AF 2023-04-28 09:50:59 +00:00
parent fbf877d797
commit 21411d5f9a

View File

@ -1,5 +1,7 @@
from __future__ import annotations
import asyncio import asyncio
from typing import Optional, TypedDict from typing import TypedDict
import discord import discord
from v6d3vote.config import myroot, prefix from v6d3vote.config import myroot, prefix
@ -142,8 +144,8 @@ class Poll:
return loaded return loaded
@classmethod @classmethod
async def load(cls, message: discord.Message) -> Optional['Poll']: async def load(cls, message: discord.Message) -> Poll | None:
saved: Optional[SavedPoll] = vote_db.get(message.id, None) saved: SavedPoll | None = vote_db.get(message.id, None)
if saved is None: if saved is None:
return None return None
assert message.guild is not None assert message.guild is not None