Skip to content

Commit

Permalink
Improved error message for bool(BoundDim)
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Oct 20, 2024
1 parent 98bd5c4 commit 5420828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def unpack(self, *dims: Shape, **kwargs):
return unpack_dim(self.obj, self.name, *dims, **kwargs)

def __bool__(self):
raise SyntaxError(f"{self} cannot be converted to bool. The property you want to access likely does not exist.")
raise SyntaxError(f"{self} cannot be converted to bool. The property you want to access likely does not exist or raised an error when evaluated.")


class _BoundDims:
Expand Down

0 comments on commit 5420828

Please sign in to comment.