Skip to content

Commit

Permalink
Overload '+' operator to concatenate ConfigSet objects
Browse files Browse the repository at this point in the history
  • Loading branch information
bernstei committed Oct 3, 2024
1 parent 6655d94 commit 9bb5dc2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wfl/configset.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ def _flat_iter(items):
yield at


def __add__(self, other):
if not isinstance(other, ConfigSet):
raise TypeError(f"unsupported operand type(s) for +: 'ConfigSet' and '{type(other)}'")
return ConfigSet([self, other])


class OutputSpec:
"""Abstraction for writing to a ConfigSet, preserving tree structure.
Expand Down

0 comments on commit 9bb5dc2

Please sign in to comment.