Skip to content

Commit

Permalink
Merge pull request #100 from jwlodek/more-verbose-error-msg
Browse files Browse the repository at this point in the history
[ENH] Update error message printed on overlapping cycles to be more verbose
  • Loading branch information
timhoffm authored Aug 2, 2024
2 parents 6499cca + 2a858e4 commit 702f61e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cycler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ def _process_keys(
r_peek: dict[K, V] = next(iter(right)) if right is not None else {}
l_key: set[K] = set(l_peek.keys())
r_key: set[K] = set(r_peek.keys())
if l_key & r_key:
raise ValueError("Can not compose overlapping cycles")
if common_keys := l_key & r_key:
raise ValueError(
f"Cannot compose overlapping cycles, duplicate key(s): {common_keys}"
)

return l_key | r_key


Expand Down

0 comments on commit 702f61e

Please sign in to comment.