diff --git a/docs/source/usage/mypy.rst b/docs/source/usage/mypy.rst new file mode 100644 index 0000000..6fadaf3 --- /dev/null +++ b/docs/source/usage/mypy.rst @@ -0,0 +1,15 @@ +ConfZ and MyPy +============== + +ConfZ heavily relies on Metaclasses for its lazy loading and singleton design. Unfortunately, MyPy has limited support +for them so far (see `docs `_). Thus, it is likely that you +will get an error similar to this:: + + Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases + +So far, the only solution is to ignore these errors:: + + class MyConfig(BaseConfig): # type: ignore + my_variable: bool + +Future versions of MyPy might be able to correctly check ConfZ classes. diff --git a/docs/source/usage/usage.rst b/docs/source/usage/usage.rst index 7e4292c..d93465a 100644 --- a/docs/source/usage/usage.rst +++ b/docs/source/usage/usage.rst @@ -12,3 +12,4 @@ This part of the documentation contains user guides explaining all aspects of Co context_manager listeners extensions + mypy