We've mostly removed gradual-guarantee unioning with Unknown now; the one place in which we still do it is if an attribute is not annotated and is initialized with = None (or another non-Literal singleton type). It's unlikely that the intent is for the attribute to only ever be None, so in this case we widen to None | Unknown.
For those who want to keep dynamic types out of their code, it would be nice to get a diagnostic when this occurs, to prompt adding an annotation.
This could be part of #622, but I think there might be advantages to making it a distinct diagnostic, or at least offering additional context in this case.
We've mostly removed gradual-guarantee unioning with
Unknownnow; the one place in which we still do it is if an attribute is not annotated and is initialized with= None(or another non-Literal singleton type). It's unlikely that the intent is for the attribute to only ever beNone, so in this case we widen toNone | Unknown.For those who want to keep dynamic types out of their code, it would be nice to get a diagnostic when this occurs, to prompt adding an annotation.
This could be part of #622, but I think there might be advantages to making it a distinct diagnostic, or at least offering additional context in this case.