Skip to content

Commit 87502b0

Browse files
committed
Metadata API: set default version for MetaFile()
This makes sense to me: if you create a new MetaFile, logically it is version 1). This does not change serialization in any way. Practical code becomes slightly nicer as metafiles = defaultdict(MetaFile) now works without lambdas. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
1 parent 45271ef commit 87502b0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tuf/api/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ class MetaFile(BaseFile):
10761076

10771077
def __init__(
10781078
self,
1079-
version: int,
1079+
version: int = 1,
10801080
length: Optional[int] = None,
10811081
hashes: Optional[Dict[str, str]] = None,
10821082
unrecognized_fields: Optional[Dict[str, Any]] = None,

0 commit comments

Comments
 (0)