From 01988735f8abde6ddc108f244ef0bbaef35ed1dd Mon Sep 17 00:00:00 2001 From: makbigc Date: Sun, 24 Mar 2019 18:43:35 +0800 Subject: [PATCH] Remove TypeError when the endpoints aren't comparable --- pandas/_libs/interval.pyx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pandas/_libs/interval.pyx b/pandas/_libs/interval.pyx index 74fbd69708de8..173be9398b634 100644 --- a/pandas/_libs/interval.pyx +++ b/pandas/_libs/interval.pyx @@ -106,12 +106,7 @@ cdef class IntervalMixin(object): @property def length(self): """Return the length of the Interval""" - try: - return self.right - self.left - except TypeError: - # length not defined for some types, e.g. string - msg = 'cannot compute length between {left!r} and {right!r}' - raise TypeError(msg.format(left=self.left, right=self.right)) + return self.right - self.left def _check_closed_matches(self, other, name='other'): """Check if the closed attribute of `other` matches.