-
Notifications
You must be signed in to change notification settings - Fork 28
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 option to ban multiple inheritance #334
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
DetachHead
commented
May 4, 2024
README.md
Outdated
@@ -143,6 +143,31 @@ unfortunately, this will cause a `reportInvalidCast` error when this rule is ena | |||
|
|||
this means that although casting between them is a common use case, `TypedDict`s and `dict`s technically do not overlap. | |||
|
|||
### `reportMultipleInheritance` - ban inheriting from multiple different base classes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add it to the playground
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment has been minimized.
This comment has been minimized.
DetachHead
commented
May 6, 2024
DetachHead
commented
May 6, 2024
This comment has been minimized.
This comment has been minimized.
DetachHead
force-pushed
the
ban-multiple-inheritance
branch
from
May 7, 2024 09:26
8706dd8
to
a4618c1
Compare
This comment has been minimized.
This comment has been minimized.
DetachHead
force-pushed
the
ban-multiple-inheritance
branch
2 times, most recently
from
May 7, 2024 09:43
49f9fc8
to
add3821
Compare
This comment has been minimized.
This comment has been minimized.
DetachHead
force-pushed
the
ban-multiple-inheritance
branch
from
May 8, 2024 07:13
add3821
to
4b4f853
Compare
DetachHead
force-pushed
the
ban-multiple-inheritance
branch
from
May 8, 2024 07:18
4b4f853
to
4d3e7df
Compare
…e` since multiple inheritance is allowed in some cases
…ng that the first base class is allowed to have a constructor
…f `reportUnsafeMultipleInheritance` is enabled
…erelease versions
DetachHead
force-pushed
the
ban-multiple-inheritance
branch
from
May 8, 2024 07:21
4d3e7df
to
5d621d1
Compare
Diff from mypy_primer, showing the effect of this PR on open source code: pyp (https://github.com/hauntsaninja/pyp)
- /tmp/mypy_primer/projects/pyp/pyp.py:240:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- /tmp/mypy_primer/projects/pyp/pyp.py:298:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- 276 errors, 0 warnings, 0 notes
+ 274 errors, 0 warnings, 0 notes
pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
+ /tmp/mypy_primer/projects/pytest-robotframework/tests/conftest.py:196:78 - error: Unnecessary "# pyright: ignore" rule: "reportMissingSuperCall"
- 2055 errors, 0 warnings, 0 notes
+ 2056 errors, 0 warnings, 0 notes
bidict (https://github.com/jab/bidict)
+ /tmp/mypy_primer/projects/bidict/bidict/_base.py:52:7 - error: Multiple inheritance is not allowed because the following base classes have `__init__` or `__new__` methods: ValuesView
+ Only the first base class is allowed to have a constructor. (reportUnsafeMultipleInheritance)
+ /tmp/mypy_primer/projects/bidict/bidict/_exc.py
+ /tmp/mypy_primer/projects/bidict/bidict/_exc.py:31:7 - error: Multiple inheritance is not allowed because the following base classes have `__init__` or `__new__` methods: BaseException
+ Only the first base class is allowed to have a constructor. (reportUnsafeMultipleInheritance)
- /tmp/mypy_primer/projects/bidict/bidict/_orderedbase.py:44:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- /tmp/mypy_primer/projects/bidict/bidict/_orderedbase.py:68:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
+ /tmp/mypy_primer/projects/bidict/bidict/_orderedbidict.py:29:7 - error: Multiple inheritance is not allowed because the following base classes have `__init__` or `__new__` methods: BidictBase
+ Only the first base class is allowed to have a constructor. (reportUnsafeMultipleInheritance)
- /tmp/mypy_primer/projects/bidict/tests/bidict_test_fixtures.py:38:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
PyWinCtl (https://github.com/Kalmat/PyWinCtl)
- /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/_main.py:447:9 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/_pywinctl_macos.py:1280:13 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/_pywinctl_win.py:1011:13 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
- 1358 errors, 0 warnings, 0 notes
+ 1355 errors, 0 warnings, 0 notes
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #120