Pacify mypy.

This commit is contained in:
Itamar Turner-Trauring 2024-01-24 08:11:45 -05:00
parent ff6e3ed56b
commit 68d63fde27

View File

@ -11,11 +11,11 @@ from cbor2 import dumps, dump
# Now, override the C extension so we can import the Python versions of loading # Now, override the C extension so we can import the Python versions of loading
# functions. # functions.
del sys.modules["cbor2"] del sys.modules["cbor2"]
sys.modules["_cbor2"] = None sys.modules["_cbor2"] = None # type: ignore[assignment]
from cbor2 import load, loads from cbor2 import load, loads
# Quick validation that we got the Python version, not the C version. # Quick validation that we got the Python version, not the C version.
assert type(load) == type(lambda: None), repr(load) assert type(load) == type(lambda: None), repr(load) # type: ignore[comparison-overlap]
assert type(loads) == type(lambda: None), repr(loads) assert type(loads) == type(lambda: None), repr(loads) # type: ignore[comparison-overlap]
__all__ = ["dumps", "loads", "dump", "load"] __all__ = ["dumps", "loads", "dump", "load"]