Use singleton enum for "not set" sentinels (#41990)

* Use singleton enum for "not set" sentinel

https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions

* Remove unused variable
This commit is contained in:
Ville Skyttä 2020-12-19 13:46:27 +02:00 committed by GitHub
parent de04a1ed67
commit 317ed418dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 139 additions and 131 deletions

View file

@ -89,7 +89,7 @@ block_async_io.enable()
fix_threading_exception_logging()
T = TypeVar("T")
_UNDEF: dict = {}
_UNDEF: dict = {} # Internal; not helpers.typing.UNDEFINED due to circular dependency
# pylint: disable=invalid-name
CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable)
CALLBACK_TYPE = Callable[[], None]