From 4c2e35e56ee58246bed569004a8245ae4a61be38 Mon Sep 17 00:00:00 2001 From: Crussader <75786691+Crussader@users.noreply.github.com> Date: Wed, 20 Oct 2021 20:56:09 +0400 Subject: [PATCH] added MISSING --- pomice/utils.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pomice/utils.py b/pomice/utils.py index a8be0b2..b1b70ec 100644 --- a/pomice/utils.py +++ b/pomice/utils.py @@ -20,7 +20,10 @@ DEALINGS IN THE SOFTWARE. import random import time -from typing import Union +from typing import ( + Union, + Any, +) from discord import AutoShardedClient, Client from discord.ext.commands import AutoShardedBot, Bot @@ -28,7 +31,8 @@ from discord.ext.commands import AutoShardedBot, Bot __all__ = [ 'ExponentialBackoff', 'NodeStats', - 'ClientType' + 'ClientType', + 'MISSING' ] ClientType = Union[AutoShardedBot, AutoShardedClient, Bot, Client] @@ -85,3 +89,13 @@ class NodeStats: def __repr__(self) -> str: return f'' + +class _MissingSentinel: + def __repr__(self) -> str: + return "MISSING" + + def __bool__(self) -> bool: + return False + + +MISSING: Any = _MissingSentinel()