@@ -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
@@ -959,7 +959,10 @@ np_1darray_dt: TypeAlias = np_1darray[np.datetime64]
959959np_1darray_td : TypeAlias = np_1darray [np .timedelta64 ]
960960np_2darray : TypeAlias = np .ndarray [tuple [int , int ], np .dtype [GenericT ]]
961961
962- NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray )
962+ if sys .version_info >= (3 , 11 ):
963+ NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray )
964+ else :
965+ NDArrayT = TypeVar ("NDArrayT" , bound = np .ndarray [Any , Any ])
963966
964967DtypeNp = TypeVar ("DtypeNp" , bound = np .dtype [np .generic ])
965968KeysArgType : TypeAlias = Any
@@ -1070,7 +1073,7 @@ if TYPE_CHECKING: # noqa: PYI002
10701073 | Scalar
10711074 | Period
10721075 | Interval [int | float | Timestamp | Timedelta ]
1073- | tuple ,
1076+ | tuple [ Any , ...] ,
10741077 )
10751078 # Use a distinct SeriesByT when using groupby with Series of known dtype.
10761079 # Essentially, an intersection between Series S1 TypeVar, and ByT TypeVar
@@ -1102,7 +1105,7 @@ GroupByObjectNonScalar: TypeAlias = (
11021105 | Grouper
11031106 | list [Grouper ]
11041107)
1105- GroupByObject : TypeAlias = Scalar | Index | GroupByObjectNonScalar | Series
1108+ GroupByObject : TypeAlias = Scalar | Index | GroupByObjectNonScalar [ _HashableTa ] | Series
11061109
11071110StataDateFormat : TypeAlias = Literal [
11081111 "tc" ,
@@ -1125,9 +1128,9 @@ StataDateFormat: TypeAlias = Literal[
11251128# `DataFrame.replace` also accepts mappings of these.
11261129ReplaceValue : TypeAlias = (
11271130 Scalar
1128- | Pattern
1131+ | Pattern [ Any ]
11291132 | NAType
1130- | Sequence [Scalar | Pattern ]
1133+ | Sequence [Scalar | Pattern [ Any ] ]
11311134 | Mapping [HashableT , ScalarT ]
11321135 | Series
11331136 | None
0 commit comments