Commit 7aed696
authored
Stubtest: check
Currently stubtest allows unsound definitions:
```python
# a.pyi
from enum import Enum
class E(Enum):
_value_: str
FOO = ...
```
```python
# a.py
from enum import Enum
class E(Enum):
FOO = 0
```
This PR teaches `stubtest` that `_value_` attribute
([spec](https://typing.python.org/en/latest/spec/enums.html#member-values))
should be used as a fallback in such case._value_ for ellipsis-valued stub enum members (#19760)1 parent 3618369 commit 7aed696
2 files changed
+39
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
| 1277 | + | |
1277 | 1278 | | |
1278 | 1279 | | |
1279 | 1280 | | |
| |||
1286 | 1287 | | |
1287 | 1288 | | |
1288 | 1289 | | |
1289 | | - | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1290 | 1293 | | |
1291 | 1294 | | |
1292 | 1295 | | |
1293 | 1296 | | |
1294 | 1297 | | |
1295 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1296 | 1305 | | |
1297 | 1306 | | |
1298 | 1307 | | |
1299 | | - | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1300 | 1312 | | |
1301 | 1313 | | |
1302 | 1314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1483 | 1483 | | |
1484 | 1484 | | |
1485 | 1485 | | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1486 | 1510 | | |
1487 | 1511 | | |
1488 | 1512 | | |
| |||
0 commit comments