@@ -179,7 +179,7 @@ def _get_data_as_items(self):
179
179
def __reduce__ (self ):
180
180
d = self ._get_attributes_dict ()
181
181
d .update (dict (self ._get_data_as_items ()))
182
- return ibase ._new_Index , (self . __class__ , d ), None
182
+ return ibase ._new_Index , (type ( self ) , d ), None
183
183
184
184
# --------------------------------------------------------------------
185
185
# Rendering Methods
@@ -592,27 +592,27 @@ def _union(self, other, sort):
592
592
and (start_s - end_o ) <= step_s
593
593
and (start_o - end_s ) <= step_s
594
594
):
595
- return self . __class__ (start_r , end_r + step_s , step_s )
595
+ return type ( self ) (start_r , end_r + step_s , step_s )
596
596
if (
597
597
(step_s % 2 == 0 )
598
598
and (abs (start_s - start_o ) <= step_s / 2 )
599
599
and (abs (end_s - end_o ) <= step_s / 2 )
600
600
):
601
- return self . __class__ (start_r , end_r + step_s / 2 , step_s / 2 )
601
+ return type ( self ) (start_r , end_r + step_s / 2 , step_s / 2 )
602
602
elif step_o % step_s == 0 :
603
603
if (
604
604
(start_o - start_s ) % step_s == 0
605
605
and (start_o + step_s >= start_s )
606
606
and (end_o - step_s <= end_s )
607
607
):
608
- return self . __class__ (start_r , end_r + step_s , step_s )
608
+ return type ( self ) (start_r , end_r + step_s , step_s )
609
609
elif step_s % step_o == 0 :
610
610
if (
611
611
(start_s - start_o ) % step_o == 0
612
612
and (start_s + step_o >= start_o )
613
613
and (end_s - step_o <= end_o )
614
614
):
615
- return self . __class__ (start_r , end_r + step_o , step_o )
615
+ return type ( self ) (start_r , end_r + step_o , step_o )
616
616
return self ._int64index ._union (other , sort = sort )
617
617
618
618
@Appender (_index_shared_docs ["join" ])
@@ -781,7 +781,7 @@ def _evaluate_numeric_binop(self, other):
781
781
rstart = op (left .start , right )
782
782
rstop = op (left .stop , right )
783
783
784
- result = self . __class__ (rstart , rstop , rstep , ** attrs )
784
+ result = type ( self ) (rstart , rstop , rstep , ** attrs )
785
785
786
786
# for compat with numpy / Int64Index
787
787
# even if we can represent as a RangeIndex, return
0 commit comments