@@ -232,7 +232,7 @@ class NDFrame(PandasObject, SelectionMixin, indexing.IndexingMixin):
232
232
def __init__ (
233
233
self ,
234
234
data : Manager ,
235
- copy : bool = False ,
235
+ copy : bool_t = False ,
236
236
attrs : Mapping [Hashable , Any ] | None = None ,
237
237
):
238
238
# copy kwarg is retained for mypy compat, is not used
@@ -249,7 +249,7 @@ def __init__(
249
249
250
250
@classmethod
251
251
def _init_mgr (
252
- cls , mgr , axes , dtype : Dtype | None = None , copy : bool = False
252
+ cls , mgr , axes , dtype : Dtype | None = None , copy : bool_t = False
253
253
) -> Manager :
254
254
""" passed a manager and a axes dict """
255
255
for a , axe in axes .items ():
@@ -377,8 +377,8 @@ def flags(self) -> Flags:
377
377
def set_flags (
378
378
self : FrameOrSeries ,
379
379
* ,
380
- copy : bool = False ,
381
- allows_duplicate_labels : bool | None = None ,
380
+ copy : bool_t = False ,
381
+ allows_duplicate_labels : bool_t | None = None ,
382
382
) -> FrameOrSeries :
383
383
"""
384
384
Return a new object with updated flags.
@@ -467,7 +467,7 @@ def _data(self):
467
467
_stat_axis_name = "index"
468
468
_AXIS_ORDERS : list [str ]
469
469
_AXIS_TO_AXIS_NUMBER : dict [Axis , int ] = {0 : 0 , "index" : 0 , "rows" : 0 }
470
- _AXIS_REVERSED : bool
470
+ _AXIS_REVERSED : bool_t
471
471
_info_axis_number : int
472
472
_info_axis_name : str
473
473
_AXIS_LEN : int
@@ -494,7 +494,7 @@ def _construct_axes_dict(self, axes=None, **kwargs):
494
494
@final
495
495
@classmethod
496
496
def _construct_axes_from_arguments (
497
- cls , args , kwargs , require_all : bool = False , sentinel = None
497
+ cls , args , kwargs , require_all : bool_t = False , sentinel = None
498
498
):
499
499
"""
500
500
Construct and returns axes if supplied in args/kwargs.
@@ -714,11 +714,11 @@ def set_axis(self: FrameOrSeries, labels, *, inplace: Literal[True]) -> None:
714
714
715
715
@overload
716
716
def set_axis (
717
- self : FrameOrSeries , labels , axis : Axis = ..., inplace : bool = ...
717
+ self : FrameOrSeries , labels , axis : Axis = ..., inplace : bool_t = ...
718
718
) -> FrameOrSeries | None :
719
719
...
720
720
721
- def set_axis (self , labels , axis : Axis = 0 , inplace : bool = False ):
721
+ def set_axis (self , labels , axis : Axis = 0 , inplace : bool_t = False ):
722
722
"""
723
723
Assign desired index to given axis.
724
724
@@ -749,7 +749,7 @@ def set_axis(self, labels, axis: Axis = 0, inplace: bool = False):
749
749
return self ._set_axis_nocheck (labels , axis , inplace )
750
750
751
751
@final
752
- def _set_axis_nocheck (self , labels , axis : Axis , inplace : bool ):
752
+ def _set_axis_nocheck (self , labels , axis : Axis , inplace : bool_t ):
753
753
# NDFrame.rename with inplace=False calls set_axis(inplace=True) on a copy.
754
754
if inplace :
755
755
setattr (self , self ._get_axis_name (axis ), labels )
@@ -993,8 +993,8 @@ def rename(
993
993
index : Renamer | None = None ,
994
994
columns : Renamer | None = None ,
995
995
axis : Axis | None = None ,
996
- copy : bool = True ,
997
- inplace : bool = False ,
996
+ copy : bool_t = True ,
997
+ inplace : bool_t = False ,
998
998
level : Level | None = None ,
999
999
errors : str = "ignore" ,
1000
1000
) -> FrameOrSeries | None :
@@ -1400,13 +1400,13 @@ def _set_axis_name(self, name, axis=0, inplace=False):
1400
1400
# Comparison Methods
1401
1401
1402
1402
@final
1403
- def _indexed_same (self , other ) -> bool :
1403
+ def _indexed_same (self , other ) -> bool_t :
1404
1404
return all (
1405
1405
self ._get_axis (a ).equals (other ._get_axis (a )) for a in self ._AXIS_ORDERS
1406
1406
)
1407
1407
1408
1408
@final
1409
- def equals (self , other : object ) -> bool :
1409
+ def equals (self , other : object ) -> bool_t :
1410
1410
"""
1411
1411
Test whether two objects contain the same elements.
1412
1412
@@ -4992,15 +4992,15 @@ def filter(
4992
4992
return self .reindex (** {name : [r for r in items if r in labels ]})
4993
4993
elif like :
4994
4994
4995
- def f (x ) -> bool :
4995
+ def f (x ) -> bool_t :
4996
4996
assert like is not None # needed for mypy
4997
4997
return like in ensure_str (x )
4998
4998
4999
4999
values = labels .map (f )
5000
5000
return self .loc (axis = axis )[values ]
5001
5001
elif regex :
5002
5002
5003
- def f (x ) -> bool :
5003
+ def f (x ) -> bool_t :
5004
5004
return matcher .search (ensure_str (x )) is not None
5005
5005
5006
5006
matcher = re .compile (regex )
0 commit comments