Skip to content
Snippets Groups Projects
Commit d182fb36 authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Fix Bound for empty BoundedSet.max/min (nan)

parent fc40b4eb
No related branches found
No related tags found
1 merge request!102Feature: domains
......@@ -44,7 +44,8 @@ class Bound(Generic[_RealT]):
if self.integral:
try:
return self.cast_lower(lower)
except OverflowError:
except (OverflowError, ValueError):
# inf or nan
return lower
return lower
if self._name.startswith('_upper'):
......@@ -52,7 +53,8 @@ class Bound(Generic[_RealT]):
if self.integral:
try:
return self.cast_upper(upper)
except OverflowError:
except (OverflowError, ValueError):
# inf or nan
return upper
return upper
raise NameError('Bound descriptor instance name should start with lower or upper')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment