Skip to content

Commit 0198873

Browse files
committed
Remove TypeError when the endpoints aren't comparable
1 parent 6e0f9a9 commit 0198873

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pandas/_libs/interval.pyx

+1-6
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,7 @@ cdef class IntervalMixin(object):
106106
@property
107107
def length(self):
108108
"""Return the length of the Interval"""
109-
try:
110-
return self.right - self.left
111-
except TypeError:
112-
# length not defined for some types, e.g. string
113-
msg = 'cannot compute length between {left!r} and {right!r}'
114-
raise TypeError(msg.format(left=self.left, right=self.right))
109+
return self.right - self.left
115110

116111
def _check_closed_matches(self, other, name='other'):
117112
"""Check if the closed attribute of `other` matches.

0 commit comments

Comments
 (0)