Summary
For example, here the inferred type is str, but the type the autocompletion tooltip renders for the attribute is str | None:
What's going on here is: in general, ty knows that the __file__ attribute for a module will be of type str | None. But for this module, ty infers a more precise type (str), because, well: we know this module has a file; we're checking it right now.
This special-casing is done here; it looks like we might need to make our autocompletion machinery aware of that special-casing somehow?
Version
No response