Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Mypy stubtest failure on disjoint_base #30551

@timhoffm

Description

@timhoffm

Bug summary

The recently released MyPy 18.1 supports PEP 800 – Disjoint bases in the type system. stubtest now flags the following errors in CI (e.g. in 0a744f0)

Actual outcome

matplotlib.dviread.Text is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub
<TypeInfo matplotlib.dviread.Text>
Runtime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/dviread.py:69
def (x, y, font, glyph, width)

Raw Output:
error: matplotlib.dviread.Text is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub
Stub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/dviread.pyi:31
<TypeInfo matplotlib.dviread.Text>
Runtime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/dviread.py:69
def (x, y, font, glyph, width)
matplotlib.container.Container is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub
<TypeInfo matplotlib.container.Container>
Runtime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/container.py:5
def (*args, **kwargs)

Raw Output:
error: matplotlib.container.Container is a disjoint base at runtime, but isn't marked with @disjoint_base in the stub
Stub: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/container.pyi:10
<TypeInfo matplotlib.container.Container>
Runtime: in file /home/runner/work/matplotlib/matplotlib/lib/matplotlib/container.py:5
def (*args, **kwargs)

Expected outcome

No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions