Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mypy issues to docs #97

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/source/usage/mypy.rst
Original file line number Diff line number Diff line change
@@ -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 <https://mypy.readthedocs.io/en/stable/metaclasses.html>`_). 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.
1 change: 1 addition & 0 deletions docs/source/usage/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This part of the documentation contains user guides explaining all aspects of Co
context_manager
listeners
extensions
mypy
Loading