@@ -774,7 +774,7 @@ XMLParsers: TypeAlias = Literal["lxml", "etree"]
774774HTMLFlavors : TypeAlias = Literal ["lxml" , "html5lib" , "bs4" ]
775775
776776# Interval closed type
777- IntervalT = TypeVar ("IntervalT" , bound = Interval )
777+ IntervalT = TypeVar ("IntervalT" , bound = Interval , default = Interval )
778778IntervalLeftRight : TypeAlias = Literal ["left" , "right" ]
779779IntervalClosedType : TypeAlias = IntervalLeftRight | Literal ["both" , "neither" ]
780780
@@ -958,7 +958,10 @@ np_1darray_dt: TypeAlias = np_1darray[np.datetime64]
958958np_1darray_td : TypeAlias = np_1darray [np .timedelta64 ]
959959np_2darray : TypeAlias = np .ndarray [tuple [int , int ], np .dtype [GenericT ]]
960960
961- NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray )
961+ if sys .version_info >= (3 , 11 ):
962+ NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray )
963+ else :
964+ NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray [Any , Any ])
962965
963966DtypeNp = TypeVar ("DtypeNp" , bound = np .dtype [np .generic ])
964967KeysArgType : TypeAlias = Any
@@ -1069,7 +1072,7 @@ if TYPE_CHECKING: # noqa: PYI002
10691072 | Scalar
10701073 | Period
10711074 | Interval [int | float | Timestamp | Timedelta ]
1072- | tuple ,
1075+ | tuple [ Any , ...] ,
10731076 )
10741077 # Use a distinct SeriesByT when using groupby with Series of known dtype.
10751078 # Essentially, an intersection between Series S1 TypeVar, and ByT TypeVar
@@ -1101,7 +1104,7 @@ GroupByObjectNonScalar: TypeAlias = (
11011104 | Grouper
11021105 | list [Grouper ]
11031106)
1104- GroupByObject : TypeAlias = Scalar | Index | GroupByObjectNonScalar | Series
1107+ GroupByObject : TypeAlias = Scalar | Index | GroupByObjectNonScalar [ _HashableTa ] | Series
11051108
11061109StataDateFormat : TypeAlias = Literal [
11071110 "tc" ,
@@ -1124,9 +1127,9 @@ StataDateFormat: TypeAlias = Literal[
11241127# `DataFrame.replace` also accepts mappings of these.
11251128ReplaceValue : TypeAlias = (
11261129 Scalar
1127- | Pattern
1130+ | Pattern [ Any ]
11281131 | NAType
1129- | Sequence [Scalar | Pattern ]
1132+ | Sequence [Scalar | Pattern [ Any ] ]
11301133 | Mapping [HashableT , ScalarT ]
11311134 | Series
11321135 | None
0 commit comments