Skip to content

Commit 6d47bdf

Browse files
authored
Ensure that VersionRange is immutable and hashable
See #20 We now ensure that a `version_constraints` attribute is a tuple Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent ca2cf4d commit 6d47bdf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/univers/version_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class VersionRange:
4040

4141
# A list of lists of VersionConstraint that are signposts on the versions
4242
# timeline
43-
constraints = attr.ib(type=list, default=attr.Factory(list))
43+
constraints = attr.ib(type=tuple, converter=tuple, default=attr.Factory(tuple))
4444

4545
def __attrs_post_init__(self, *args, **kwargs):
4646
self.constraints.sort()

0 commit comments

Comments
 (0)