Describe the Bug
In a setup like
from typing import reveal_type
if input():
x = ["a"]
reveal_type(x)
else:
x = []
reveal_type(x)
reveal_type(x)
y = [] if input() else ["a"]
reveal_type(y)
pyright infers the types of both x and y as list[str], while pyrefly ends with list[str] | list[Unknown]
pyright
pyrefly
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
In a setup like
pyright infers the types of both x and y as
list[str], while pyrefly ends withlist[str] | list[Unknown]pyright
pyrefly
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response