We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
Mypy returns
error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
when I combine a class with a custom metaclass and a str class
To Reproduce
This works
class M1(type): pass class A1(metaclass=M1): pass class CorrectMeta(M1, type): pass class B2(A1, int, metaclass=CorrectMeta): pass
but this not - I only replaced int with str
int
str
class M1(type): pass class A1(metaclass=M1): pass class CorrectMeta(M1, type): pass class B2(A1, str, metaclass=CorrectMeta): pass
Expected Behavior
There is no error
Actual Behavior
Mypy returned an error
Your Environment
mypy -p mypackage
mypy.ini
[tool.mypy] files = "**/**.py" plugins = [ "pydantic.mypy" ] ignore_missing_imports = false scripts_are_modules = false namespace_packages = true disallow_untyped_defs = true disallow_incomplete_defs = true no_implicit_optional = true show_error_context = true show_traceback = true strict_equality = true check_untyped_defs = true [tool.pydantic-mypy] init_forbid_extra = true init_typed = true warn_required_dynamic_aliases = true warn_untyped_fields = true [[tool.mypy.overrides]] module = [ "tests.*" ] disallow_untyped_defs = false disallow_incomplete_defs = false [[tool.mypy.overrides]] module = [ "request_session.*", "sentry_sdk.*", "structlog.*", ] ignore_missing_imports = true ignore_errors = true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
Mypy returns
when I combine a class with a custom metaclass and a str class
To Reproduce
This works
but this not - I only replaced
int
withstr
Expected Behavior
There is no error
Actual Behavior
Mypy returned an error
Your Environment
mypy -p mypackage
mypy.ini
(and other config files):3.9, 3.10, 3.11
The text was updated successfully, but these errors were encountered: