Skip to content

Adapt ast types for mypy 0.990  #9129

@kasium

Description

@kasium

With mypy 0.990 the complex/int/float promotion was changed (see python/mypy#14030).
Therefore checks like isinstance(node, ast.Num) and isinstance(node.n, int) fails with strict mode enabled.

The recommendation by mypy is to change complex to Union[int, float, complex]. Are there any objections to do so in the ast module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions