Commit b95e923
Better runtime TypedDict (pythonGH-17214)
This patch enables downstream projects inspecting a TypedDict subclass at runtime to tell which keys are optional.
This is essential for generating test data with Hypothesis or validating inputs with typeguard or pydantic.1 parent 5b00c6d commit b95e923
File tree
3 files changed
+25
-3
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3741 | 3741 | | |
3742 | 3742 | | |
3743 | 3743 | | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
3744 | 3751 | | |
3745 | 3752 | | |
3746 | 3753 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
1718 | 1721 | | |
1719 | | - | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
1720 | 1729 | | |
| 1730 | + | |
| 1731 | + | |
1721 | 1732 | | |
1722 | 1733 | | |
1723 | 1734 | | |
| |||
1744 | 1755 | | |
1745 | 1756 | | |
1746 | 1757 | | |
1747 | | - | |
1748 | | - | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1749 | 1761 | | |
1750 | 1762 | | |
1751 | 1763 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments