Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Document when multiple inheritance is not allowed #136843

Copy link
Copy link
@JelleZijlstra

Description

@JelleZijlstra
Issue body actions

Python generally supports multiple inheritance, but only under certain conditions (the classes must have compatible memory layouts, compatible metaclasses, and a compatible MRO). This behavior is quite stable in practice but the documentation doesn't discuss it very much:

I propose to add a section to the language reference (not the tutorial) about multiple inheritance, explaining how it works and when it doesn't.

Relatedly, I just posted a proposal to allow type checkers to better support this: https://discuss.python.org/t/solid-bases-for-detecting-incompatible-base-classes/99280

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir
    No fields configured for issues without a type.

    Projects

    Status
    Todo
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.