ruff/crates/red_knot_python_semantic/resources/mdtest/attributes.md
Micha Reiser 6aaf1d9446
[red-knot] Remove lint-phase (#13922)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-25 18:40:52 +00:00

239 B

Class attributes

Union of attributes

def bool_instance() -> bool:
    return True

flag = bool_instance()

if flag:
    class C:
        x = 1

else:
    class C:
        x = 2

reveal_type(C.x)  # revealed: Literal[1, 2]