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