Skip to content

Commit 2340390

Browse files
committed
removed __add__ operator overloading in Hyperedge/Atom
1 parent 7ae9b5a commit 2340390

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- `read_source` renamed to `parse_source`; `read_source_to_jsonl` renamed to `parse_source_to_jsonl`.
1818

1919
### Removed
20+
- `__add__` operator overloading in `Hyperedge`/`Atom`.
2021

2122
## [0.9.0] - 05-04-2026
2223

src/hyperbase/hyperedge.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,6 @@ def variable_name(self) -> str:
426426

427427
return variable_name(self)
428428

429-
def __add__(self, other: Hyperedge | tuple[Any, ...] | list[Any]) -> Hyperedge:
430-
if isinstance(other, (list, tuple)) and not isinstance(other, Hyperedge):
431-
return Hyperedge(self._edges + tuple(other))
432-
elif isinstance(other, Hyperedge) and other.atom:
433-
return Hyperedge((*self._edges, other))
434-
else:
435-
return Hyperedge(self._edges + tuple(other))
436-
437429
def __str__(self) -> str:
438430
s = " ".join([str(edge) for edge in self._edges if edge])
439431
return f"({s})"
@@ -594,14 +586,6 @@ def remove_argroles(self) -> Atom:
594586
def arguments_with_role(self, argrole: str) -> list[Hyperedge]:
595587
return []
596588

597-
def __add__(self, other: Hyperedge | tuple[Any, ...] | list[Any]) -> Hyperedge:
598-
if isinstance(other, (list, tuple)) and not isinstance(other, Hyperedge):
599-
return Hyperedge((self, *tuple(other)))
600-
elif isinstance(other, Hyperedge) and other.atom:
601-
return Hyperedge((self, other))
602-
else:
603-
return Hyperedge((self, *tuple(other)))
604-
605589
def __repr__(self) -> str:
606590
return str(self)
607591

0 commit comments

Comments
 (0)