1#!/usr/bin/env python3
2"""
3A Module for useful typeguard functions.
4
5"""
6# Imports:
7from __future__ import annotations
8
9# ##-- stdlib imports
10import datetime
11import enum
12import functools as ftz
13import itertools as itz
14import logging as logmod
15import pathlib as pl
16import re
17import time
18import collections
19import contextlib
20import hashlib
21from copy import deepcopy
22from uuid import UUID, uuid1
23from weakref import ref
24import atexit # for @atexit.register
25import faulthandler
26# ##-- end stdlib imports
27
28# ##-- types
29# isort: off
30# General
31import abc
32import collections.abc
33import typing
34import types
35from typing import cast, assert_type, assert_never
36from typing import Generic, NewType, Never
37from typing import no_type_check, final, override, overload
38# Protocols and Interfaces:
39from typing import Protocol, runtime_checkable
40# isort: on
41# ##-- end types
42
43# ##-- type checking
44# isort: off
45if typing.TYPE_CHECKING:
46 from typing import Final, ClassVar, Any, Self
47 from typing import Literal, LiteralString
48 from typing import TypeGuard
49 from collections.abc import Iterable, Iterator, Callable, Generator
50 from collections.abc import Sequence, Mapping, MutableMapping, Hashable
51
52 from jgdv import Maybe
53## isort: on
54# ##-- end type checking
55
56##-- logging
57logging = logmod.getLogger(__name__)
58##-- end logging
59
60# Vars:
61
62# Body:
63
[docs]
64def is_none(val:Maybe) -> TypeGuard[None]:
65 """ Test whether a value is None or not """
66 return val is None