mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
239 B
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]