Files
ruff/crates
Charlie Marsh e4ba29392b [ty] Fix __file__ type in completions to show str instead of str | None (#22510)
## Summary

The type inference system already correctly special-cases `__file__` to
return `str` for the current module (since the code is executing from an
existing file). However, the completion system was bypassing this logic
and pulling `__file__: str | None` directly from `types.ModuleType` in
typeshed.

This PR adds implicit module globals (like `__file__`, `__name__`, etc.)
with their correctly-typed values to completions, reusing the existing
`module_type_implicit_global_symbol` function that already handles the
special-casing.

Closes https://github.com/astral-sh/ty/issues/2445.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-01-12 14:20:32 +00:00
..
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-08 12:51:47 -06:00
2026-01-02 19:58:15 +00:00