Commit 5e65d67
Jussi Kukkonen
Metadata API: Make Metadata constructor Generic
In from_dict() we cannot at static type check time tell what the
specific signed type so have to cast, but the constructor can be
properly Generic so in the following md is automatically annotated
as "Metadata[Root]" and md.signed as "Root":
root = Root(...)
md = Metadata(root, OrderedDict())
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>1 parent 0baff95 commit 5e65d67
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 80 | + | |
| 81 | + | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
| |||
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
130 | | - | |
| 127 | + | |
| 128 | + | |
131 | 129 | | |
132 | 130 | | |
133 | 131 | | |
| |||
0 commit comments