## Summary Porting infer tests to new markdown tests framework. Link to the corresponding issue: #13696 --------- Co-authored-by: Carl Meyer <carl@astral.sh>
460 B
460 B
Unbound
Maybe unbound
if flag:
y = 3
x = y
reveal_type(x) # revealed: Unbound | Literal[3]
Unbound
x = foo; foo = 1
reveal_type(x) # revealed: Unbound
Unbound class variable
Class variables can reference global variables unless overridden within the class scope.
x = 1
class C:
y = x
if flag:
x = 2
reveal_type(C.x) # revealed: Unbound | Literal[2]
reveal_type(C.y) # revealed: Literal[1]