Skip to content
Snippets Groups Projects
Commit 70e5d50a authored by Stefano Zacchiroli's avatar Stefano Zacchiroli
Browse files

identifiers.py: do not inherit from on-the-fly namedtuple

parent 54c66426
No related branches found
Tags v0.0.45
No related merge requests found
...@@ -638,14 +638,17 @@ _object_type_map = { ...@@ -638,14 +638,17 @@ _object_type_map = {
} }
class PersistentId(NamedTuple( _PersistentId = NamedTuple(
'PersistentId', [ 'PersistentId', [
('namespace', str), ('namespace', str),
('scheme_version', int), ('scheme_version', int),
('object_type', str), ('object_type', str),
('object_id', str), ('object_id', str),
('metadata', Dict[str, Any]), ('metadata', Dict[str, Any]),
])): ])
class PersistentId(_PersistentId):
""" """
Named tuple holding the relevant info associated to a Software Heritage Named tuple holding the relevant info associated to a Software Heritage
persistent identifier. persistent identifier.
......
...@@ -110,7 +110,7 @@ class MerkleNode(dict, metaclass=abc.ABCMeta): ...@@ -110,7 +110,7 @@ class MerkleNode(dict, metaclass=abc.ABCMeta):
""" """
__slots__ = ['parents', 'data', '__hash', 'collected'] __slots__ = ['parents', 'data', '__hash', 'collected']
type = None # type: Optional[str] type = None # type: Optional[str] # TODO: make this an enum
"""Type of the current node (used as a classifier for :func:`collect`)""" """Type of the current node (used as a classifier for :func:`collect`)"""
def __init__(self, data=None): def __init__(self, data=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment