Repository navigation
Commit 9378f79
Lukasz Langa
get_type_hints(): find the right globalns for classes
This makes the default behavior (without specifying `globalns` manually) more
predictable for users.
Implementation assumes the class has a `__module__` attribute and that module
is present in `sys.modules`.
This is backwards compatible, will just raise fewer exceptions in naive user
code.1 parent cc89ce8 commit 9378f79
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | | - | |
| 1663 | + | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | 1666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
1484 | | - | |
1485 | | - | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1486 | 1487 | | |
1487 | 1488 | | |
1488 | 1489 | | |
| |||
1494 | 1495 | | |
1495 | 1496 | | |
1496 | 1497 | | |
1497 | | - | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
1498 | 1502 | | |
1499 | 1503 | | |
1500 | 1504 | | |
| |||
0 commit comments