Skip to content

_Attrib type is not comparable to dict[str, str] even though it works at runtime #98

@DetachHead

Description

@DetachHead
from lxml.etree import XML

assert XML(b"<a foo='bar'></a>").attrib == {'foo': 'bar'}

mypy complains about this code, even though it works at runtime:

Non-overlapping equality check (left operand type: "_Attrib", right operand type: "dict[str, str]")

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