@@ -263,7 +263,7 @@ def _simple_new(
263
263
cls : type [IntervalArrayT ],
264
264
left ,
265
265
right ,
266
- closed = None ,
266
+ closed : IntervalClosedType | None = None ,
267
267
copy : bool = False ,
268
268
dtype : Dtype | None = None ,
269
269
verify_integrity : bool = True ,
@@ -416,7 +416,7 @@ def _from_factorized(
416
416
def from_breaks (
417
417
cls : type [IntervalArrayT ],
418
418
breaks ,
419
- closed = "right" ,
419
+ closed : IntervalClosedType | None = "right" ,
420
420
copy : bool = False ,
421
421
dtype : Dtype | None = None ,
422
422
) -> IntervalArrayT :
@@ -492,7 +492,7 @@ def from_arrays(
492
492
cls : type [IntervalArrayT ],
493
493
left ,
494
494
right ,
495
- closed = "right" ,
495
+ closed : IntervalClosedType | None = "right" ,
496
496
copy : bool = False ,
497
497
dtype : Dtype | None = None ,
498
498
) -> IntervalArrayT :
@@ -956,10 +956,10 @@ def _concat_same_type(
956
956
-------
957
957
IntervalArray
958
958
"""
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 :
961
961
raise ValueError ("Intervals must all be closed on the same side." )
962
- closed = closed .pop ()
962
+ closed = closed_set .pop ()
963
963
964
964
left = np .concatenate ([interval .left for interval in to_concat ])
965
965
right = np .concatenate ([interval .right for interval in to_concat ])
@@ -1328,7 +1328,7 @@ def overlaps(self, other):
1328
1328
# ---------------------------------------------------------------------
1329
1329
1330
1330
@property
1331
- def closed (self ):
1331
+ def closed (self ) -> IntervalClosedType :
1332
1332
"""
1333
1333
Whether the intervals are closed on the left-side, right-side, both or
1334
1334
neither.
0 commit comments