Skip to content

(🎁) Error when __get__ returns incompatible type #17360

Open
@KotlinIsland

Description

@KotlinIsland
class A: ...
class B(A):
    def __get__(self, i, o) -> int:
        return 1
class Something:
    a: A = B()
reveal_type(Something.a)  # Revealed type is "A"

actual value at runtime is int

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions