FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-148639: Implement PEP 800 (typing.disjoint_base) by JelleZijlstra · Pull Request #148640 · python/cpython · GitHub

Repository navigation

gh-148639: Implement PEP 800 (typing.disjoint_base) - #148640

Merged
JelleZijlstra merged 7 commits into
python:mainfrom
JelleZijlstra:pep800
Apr 18, 2026
Merged

JelleZijlstra merged 7 commits into
python:mainfrom
JelleZijlstra:pep800

Conversation

JelleZijlstra commented Apr 16, 2026 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

Comment thread Doc/library/typing.rst
Comment thread Lib/typing.py
Comment thread Doc/library/typing.rst
JelleZijlstra and others added 3 commits April 16, 2026 05:51
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>

carljm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, thank you!

Comment thread Lib/typing.py Outdated
"""This decorator marks a class as a disjoint base.

Child classes of a disjoint base cannot inherit from other disjoint bases that are
not parent classes of the disjoint base.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we need to say "parent or child" here, not just "parent", similar to the documentation wording.

Comment thread Doc/library/typing.rst Outdated
Type checkers do not allow child classes of a disjoint base ``C`` to
inherit from other disjoint bases that are not parent or child classes of ``C``.

For example:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we either need a double colon here or a .. testcode:: directive, for this example to render properly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good call, double colon works

JelleZijlstra merged commit 92164dc into python:main Apr 18, 2026
51 checks passed
JelleZijlstra deleted the pep800 branch April 18, 2026 02:20
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL