Skip to content

Commit 1fe7cae

Browse files
committed
revisit BomRef
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 8eb7786 commit 1fe7cae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cyclonedx/model/bom_ref.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def value(self, value: Optional[str]) -> None:
4242

4343
def __eq__(self, other: object) -> bool:
4444
if isinstance(other, BomRef):
45-
return str(other) == str(self)
45+
return other._value == self._value
4646
return False
4747

4848
def __lt__(self, other: Any) -> bool:
@@ -57,4 +57,7 @@ def __repr__(self) -> str:
5757
return f'<BomRef {self._value!r}>'
5858

5959
def __str__(self) -> str:
60-
return self.value or ''
60+
return self._value or ''
61+
62+
def __bool__(self) -> bool:
63+
return self._value is not None

0 commit comments

Comments
 (0)