@@ -263,7 +263,7 @@ def _simple_new(
263263 cls : type [IntervalArrayT ],
264264 left ,
265265 right ,
266- closed = None ,
266+ closed : IntervalClosedType | None = None ,
267267 copy : bool = False ,
268268 dtype : Dtype | None = None ,
269269 verify_integrity : bool = True ,
@@ -416,7 +416,7 @@ def _from_factorized(
416416 def from_breaks (
417417 cls : type [IntervalArrayT ],
418418 breaks ,
419- closed = "right" ,
419+ closed : IntervalClosedType | None = "right" ,
420420 copy : bool = False ,
421421 dtype : Dtype | None = None ,
422422 ) -> IntervalArrayT :
@@ -492,7 +492,7 @@ def from_arrays(
492492 cls : type [IntervalArrayT ],
493493 left ,
494494 right ,
495- closed = "right" ,
495+ closed : IntervalClosedType | None = "right" ,
496496 copy : bool = False ,
497497 dtype : Dtype | None = None ,
498498 ) -> IntervalArrayT :
@@ -956,10 +956,10 @@ def _concat_same_type(
956956 -------
957957 IntervalArray
958958 """
959- closed = {interval .closed for interval in to_concat }
960- if len (closed ) != 1 :
959+ closed_set = {interval .closed for interval in to_concat }
960+ if len (closed_set ) != 1 :
961961 raise ValueError ("Intervals must all be closed on the same side." )
962- closed = closed .pop ()
962+ closed = closed_set .pop ()
963963
964964 left = np .concatenate ([interval .left for interval in to_concat ])
965965 right = np .concatenate ([interval .right for interval in to_concat ])
@@ -1328,7 +1328,7 @@ def overlaps(self, other):
13281328 # ---------------------------------------------------------------------
13291329
13301330 @property
1331- def closed (self ):
1331+ def closed (self ) -> IntervalClosedType :
13321332 """
13331333 Whether the intervals are closed on the left-side, right-side, both or
13341334 neither.
0 commit comments