Regression in 0.920 / 0.930 compared with 0.910.
fromtypingimportAnydeffunc() ->Any:
...
var=func()
reveal_type(var) # Anyassertisinstance(var, bool)
reveal_type(var) # boolifvar:
reveal_type(var) # Literal[True]passreveal_type(var) # Any -> should still be 'bool'!
The type should not be lost if it can't be narrowed to Literal[True] or Literal[False]. It's a side effect of #10389. The issue was already mentioned #10389 (comment) but hasn't been addressed yet.
/CC: @ethan-leba
Regression in
0.920/0.930compared with0.910.The type should not be lost if it can't be narrowed to
Literal[True]orLiteral[False]. It's a side effect of #10389. The issue was already mentioned #10389 (comment) but hasn't been addressed yet./CC: @ethan-leba