python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.27k stars 2.79k forks source link

Do not report plugin-generated methods with `explicit-override` #17433

Closed sobolevn closed 3 months ago

sobolevn commented 3 months ago

Closes https://github.com/typeddjango/django-stubs/issues/2226 Closes https://github.com/python/mypy/issues/17417 Closes https://github.com/python/mypy/pull/17370 Closes https://github.com/python/mypy/issues/17224 This is an alternative to https://github.com/python/mypy/pull/17418

Thanks a lot to @sterliakov, I took a dataclasses test case from #17370

sobolevn commented 3 months ago

CC @intgr and @flaeppe since this solves django-stubs issue. CC @JukkaL in a hope for a review :)

github-actions[bot] commented 3 months ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

cdce8p commented 3 months ago

This PR looks similar (although with more tests) to #17370 which addresses the same issue.

sobolevn commented 3 months ago

Thanks! Indeed, I will take a dataclasses test case from there as well.

github-actions[bot] commented 3 months ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅