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
[stubtest] Allow runtime-existing aliases of types marked as @type_check_only (#19568)
In typeshed, there's a few cases of stubs like this:
```python
class _DoesNotExist: ... # does not exist at runtime
if sys.version_info >= (3, X):
Exists = _DoesNotExist
```
Ideally, it would be nice to mark `_DoesNotExit` as `@type_check_only`
to make it clear that this type isn't available at runtime. However,
this currently can't be done, because doing so will make stubtest think
that `Exists` is also `@type_check_only`, which sets off alarm bells due
to `Exists` being available at runtime.
This PR makes it so stubtest doesn't consider `@type_check_only`-status
when checking type alias targets, making it possible to mark types like
the above as `@type_check_only`.
0 commit comments