Skip to content

Operations on None should fall back to object #1766

Closed
@rwbarton

Description

@rwbarton
rwbarton@morphism:~/mypy$ python3 -m mypy --strict-optional -c 'None == None'
<string>:1: error: Unsupported left operand type for == (None)
rwbarton@morphism:~/mypy$ python3 -m mypy --strict-optional -c 'str(None)'
<string>:1: error: No overload variant of "str" matches argument types [builtins.None]

These should not be errors, as the type of None is a subtype of object.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions