Skip to content

ty incorrectly thinks all objects have an __mro__ attribute #986

@AlexWaygood

Description

@AlexWaygood

Summary

reveal_type(print.__mro__)  # revealed: tuple[<class 'FunctionType'>, <class 'object'>]
reveal_type(object().__mro__)  # revealed: tuple[<class 'object'>]

^Both those attribute accesses fail at runtime, but ty doesn't emit any diagnostics here.

https://play.ty.dev/ffdf65ae-e05f-493e-9fec-5ea6675786c9

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    attribute accessInstance attributes, class attributes, etc.bugSomething isn't workingruntime semanticsAccurate modeling of how Python's semantics work at runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions