From 7eb175fb63af050bbd3761b315f3df81af33a593 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Fri, 10 Mar 2023 13:20:47 +0000 Subject: [PATCH] Document how inheritance on Metadata classes works --- codearchiver/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codearchiver/core.py b/codearchiver/core.py index f5ba43c..510bd5c 100644 --- a/codearchiver/core.py +++ b/codearchiver/core.py @@ -83,7 +83,11 @@ class MetadataField: class Metadata(list[tuple[str, str]]): - '''Metadata (key-value mapping, possibly with repeated keys) of a file produced by a module''' + ''' + Metadata (key-value mapping, possibly with repeated keys) of a file produced by a module + + Fields are inherited. Subclasses meant to be usable should define their own version; the 'Metadata version' field is set by `Module.create_metadata` and collects all declared versions. + ''' fields: tuple[MetadataField] = ( MetadataField('codearchiver version', required = True, repeatable = False),