Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def normalize_interval(a, b):
if a <= b: return (a, b)
else: return (a, a)
# good version
def intersect(oth):
return interval(normalize_interval(min(self.hi, oth,hi), max(self.low, oth.low)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment