@@ -153,7 +153,7 @@ def make_empty(self, axes=None):
153153 blocks = np .array ([], dtype = self .array_dtype )
154154 else :
155155 blocks = []
156- return self . __class__ (blocks , axes )
156+ return type ( self ) (blocks , axes )
157157
158158 def __nonzero__ (self ):
159159 return True
@@ -316,7 +316,7 @@ def __len__(self) -> int:
316316 return len (self .items )
317317
318318 def __repr__ (self ) -> str :
319- output = pprint_thing (self . __class__ . __name__ )
319+ output = type (self ). __name__
320320 for i , ax in enumerate (self .axes ):
321321 if i == 0 :
322322 output += "\n Items: {ax}" .format (ax = ax )
@@ -430,7 +430,7 @@ def apply(
430430
431431 if len (result_blocks ) == 0 :
432432 return self .make_empty (axes or self .axes )
433- bm = self . __class__ (
433+ bm = type ( self ) (
434434 result_blocks , axes or self .axes , do_integrity_check = do_integrity_check
435435 )
436436 bm ._consolidate_inplace ()
@@ -519,7 +519,7 @@ def get_axe(block, qs, axes):
519519 for b in blocks
520520 ]
521521
522- return self . __class__ (blocks , new_axes )
522+ return type ( self ) (blocks , new_axes )
523523
524524 # single block, i.e. ndim == {1}
525525 values = concat_compat ([b .values for b in blocks ])
@@ -629,7 +629,7 @@ def comp(s, regex=False):
629629 rb = new_rb
630630 result_blocks .extend (rb )
631631
632- bm = self . __class__ (result_blocks , self .axes )
632+ bm = type ( self ) (result_blocks , self .axes )
633633 bm ._consolidate_inplace ()
634634 return bm
635635
@@ -724,7 +724,7 @@ def combine(self, blocks, copy=True):
724724 axes = list (self .axes )
725725 axes [0 ] = self .items .take (indexer )
726726
727- return self . __class__ (new_blocks , axes , do_integrity_check = False )
727+ return type ( self ) (new_blocks , axes , do_integrity_check = False )
728728
729729 def get_slice (self , slobj , axis = 0 ):
730730 if axis >= self .ndim :
@@ -741,7 +741,7 @@ def get_slice(self, slobj, axis=0):
741741 new_axes = list (self .axes )
742742 new_axes [axis ] = new_axes [axis ][slobj ]
743743
744- bm = self . __class__ (new_blocks , new_axes , do_integrity_check = False )
744+ bm = type ( self ) (new_blocks , new_axes , do_integrity_check = False )
745745 bm ._consolidate_inplace ()
746746 return bm
747747
@@ -917,7 +917,7 @@ def consolidate(self):
917917 if self .is_consolidated ():
918918 return self
919919
920- bm = self . __class__ (self .blocks , self .axes )
920+ bm = type ( self ) (self .blocks , self .axes )
921921 bm ._is_consolidated = False
922922 bm ._consolidate_inplace ()
923923 return bm
@@ -1251,7 +1251,7 @@ def reindex_indexer(
12511251
12521252 new_axes = list (self .axes )
12531253 new_axes [axis ] = new_axis
1254- return self . __class__ (new_blocks , new_axes )
1254+ return type ( self ) (new_blocks , new_axes )
12551255
12561256 def _slice_take_blocks_ax0 (self , slice_or_indexer , fill_tuple = None ):
12571257 """
@@ -1521,9 +1521,7 @@ def get_slice(self, slobj, axis=0):
15211521 if axis >= self .ndim :
15221522 raise IndexError ("Requested axis not found in manager" )
15231523
1524- return self .__class__ (
1525- self ._block ._slice (slobj ), self .index [slobj ], fastpath = True
1526- )
1524+ return type (self )(self ._block ._slice (slobj ), self .index [slobj ], fastpath = True )
15271525
15281526 @property
15291527 def index (self ):
0 commit comments