You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 fix(resolver): accept guarded code the interpreter rejects
A TYPE_CHECKING block is read by type checkers, not run by the interpreter,
so it holds constructs that raise when executed. xarray writes
TypeVar("T_XarrayOther", bound="DataArray" | Dataset), which is a TypeError
at runtime. Executing the guard to recover its names hit that error, warned
about a failed type import, and then warned a second time when the
annotation using the name could not resolve. Both warnings pointed at code
that is correct.
An import that fails still warns, since a missing dependency is worth
knowing about. Any other statement now stands its names in as forward
references, which is what a type checker sees and what the renderer already
knows how to print.
Closes#751
0 commit comments