@@ -740,7 +740,7 @@ def isin(self, values) -> npt.NDArray[np.bool_]:
740740 if not hasattr (values , "dtype" ):
741741 values = np .asarray (values )
742742
743- if values .dtype .kind in [ "f" , "i" , "u" , "c" ] :
743+ if values .dtype .kind in "fiuc" :
744744 # TODO: de-duplicate with equals, validate_comparison_value
745745 return np .zeros (self .shape , dtype = bool )
746746
@@ -769,7 +769,7 @@ def isin(self, values) -> npt.NDArray[np.bool_]:
769769 except ValueError :
770770 return isin (self .astype (object ), values )
771771
772- if self .dtype .kind in [ "m" , "M" ] :
772+ if self .dtype .kind in "mM" :
773773 self = cast ("DatetimeArray | TimedeltaArray" , self )
774774 values = values .as_unit (self .unit )
775775
@@ -1205,7 +1205,7 @@ def _sub_nat(self):
12051205 # For period dtype, timedelta64 is a close-enough return dtype.
12061206 result = np .empty (self .shape , dtype = np .int64 )
12071207 result .fill (iNaT )
1208- if self .dtype .kind in [ "m" , "M" ] :
1208+ if self .dtype .kind in "mM" :
12091209 # We can retain unit in dtype
12101210 self = cast ("DatetimeArray| TimedeltaArray" , self )
12111211 return result .view (f"timedelta64[{ self .unit } ]" )
0 commit comments