Skip to content

Support for Python 3.15 typing.disjoint_bases #21630

@dalcinl

Description

@dalcinl

Bug Report

Mypy does not recognize disjoint_base as an attribute of the typing module with Python 3.15.

Python 3.15.0b2 already exposes typing.disjoint_bases:
https://docs.python.org/3.15/whatsnew/3.15.html
https://docs.python.org/3.15/library/typing.html#typing.disjoint_base

To Reproduce

$ mypy --version
mypy 2.1.0 (compiled: yes)
$ echo "from typing import disjoint_base" > /tmp/test.py
$ mypy --python-version 3.15 /tmp/test.py 
/tmp/test.py:1: error: Module "typing" has no attribute "disjoint_base"  [attr-defined]
/tmp/test.py:1: note: Use `from typing_extensions import disjoint_base` instead
/tmp/test.py:1: note: See https://mypy.readthedocs.io/en/stable/runtime_troubles.html#using-new-additions-to-the-typing-module
Found 1 error in 1 file (checked 1 source file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions