-
-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
The Component
class' __hash__
implementation attempts to hash an unhashable list of Property
objects if present. This prevents Component
objects from being compared, which in turn prevents one from adding Component
objects to Bom
objects via Bom
's add_component
method.
Example:
from cyclonedx.model.component import Component
from cyclonedx.model import Property
component1 = Component("component 1", properties=[Property("prop 1", "value 1")])
component2 = Component("component 2")
component1 == component2
Results in
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/python3.8/site-packages/cyclonedx/model/component.py", line 508, in __eq__
return hash(other) == hash(self)
File "/lib/python3.8/site-packages/cyclonedx/model/component.py", line 512, in __hash__
return hash((
TypeError: unhashable type: 'list'
Library version: 1.3.0
OS: CentOS 8
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working