Skip to content

gh-136843: Document how multiple inheritance works #136844

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

Merged
merged 7 commits into from
Jul 28, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Update Doc/reference/compound_stmts.rst
Co-authored-by: Akuli <akuviljanen17@gmail.com>
  • Loading branch information
JelleZijlstra and Akuli authored Jul 24, 2025
commit 7128c118eab29e5e2c0c6a022d86c420fa9e296c
6 changes: 3 additions & 3 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1545,9 +1545,9 @@ resolve a consistent MRO that satisfies these rules from the list of bases provi
...
TypeError: Cannot create a consistent method resolution order (MRO) for bases Base, Child

In the MRO of ``Grandchild``, ``Child`` must appear before ``Base`` because it is first
in the base class list, but it must also appear after ``Base`` because it is a child of
``Base``. This is a contradiction, so the class cannot be defined.
In the MRO of ``Grandchild``, ``Base`` must appear before ``Child`` because it is first
in the base class list, but it must also appear after ``Child`` because it is a parent of
``Child``. This is a contradiction, so the class cannot be defined.

If some of the bases have a custom :term:`metaclass`, the metaclass of the resulting class
is chosen among the metaclasses of the bases and the explicitly specified metaclass of the
Expand Down
Loading