From 44d9939c1ce2bc2530aed89ca7b504fe035df4a9 Mon Sep 17 00:00:00 2001 From: Trung Dong Huynh Date: Wed, 29 May 2024 17:53:20 +0100 Subject: [PATCH] Fixed documentation for ProvRecord.get_attribute() #153 --- src/prov/model.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/prov/model.py b/src/prov/model.py index 5df3b60..9c47e9d 100644 --- a/src/prov/model.py +++ b/src/prov/model.py @@ -242,7 +242,7 @@ def __init__(self, bundle, identifier, attributes=None): """ self._bundle = bundle self._identifier = identifier - self._attributes = defaultdict(set) + self._attributes: dict[QualifiedName, set] = defaultdict(set) if attributes: self.add_attributes(attributes) @@ -273,12 +273,13 @@ def add_asserted_type(self, type_identifier): """ self._attributes[PROV_TYPE].add(type_identifier) - def get_attribute(self, attr_name): + def get_attribute(self, attr_name) -> set: """ Returns the attribute of the given name. :param attr_name: Name of the attribute. - :return: Tuple (name, value) + :return: Set of value(s) of the specified attribute. + :rtype: set """ attr_name = self._bundle.valid_qualified_name(attr_name) return self._attributes[attr_name]