Commit e8147f2
authored
[stubtest] Allow runtime-existing aliases of types marked as
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`.@type_check_only (#19568)1 parent c5a4efe commit e8147f2
2 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
510 | 514 | | |
511 | | - | |
| 515 | + | |
512 | 516 | | |
513 | 517 | | |
514 | 518 | | |
| |||
1449 | 1453 | | |
1450 | 1454 | | |
1451 | 1455 | | |
1452 | | - | |
| 1456 | + | |
1453 | 1457 | | |
1454 | 1458 | | |
1455 | 1459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2472 | 2472 | | |
2473 | 2473 | | |
2474 | 2474 | | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
2475 | 2486 | | |
2476 | 2487 | | |
2477 | 2488 | | |
| |||
0 commit comments