2020)
2121
2222_T_co = TypeVar ("_T_co" , covariant = True )
23+ _KT_co = TypeVar ("_KT_co" , covariant = True )
24+ _VT_co = TypeVar ("_VT_co" , covariant = True )
2325
2426
2527@runtime_checkable
@@ -28,8 +30,8 @@ def read(self, length: int = ..., /) -> _T_co: ...
2830
2931
3032@runtime_checkable
31- class SupportsItems (Protocol ):
32- def items (self ) -> Iterable [tuple [Any , Any ]]: ...
33+ class SupportsItems (Protocol [ _KT_co , _VT_co ] ):
34+ def items (self ) -> Iterable [tuple [_KT_co , _VT_co ]]: ...
3335
3436
3537# These are needed at runtime for default_hooks() return type
@@ -79,15 +81,15 @@ class _ValidatedRequest(PreparedRequest):
7981 str | bytes | int | float | Iterable [str | bytes | int | float ] | None
8082 )
8183 ParamsType : TypeAlias = (
82- Mapping [_ParamsMappingKeyType , _ParamsMappingValueType ]
84+ SupportsItems [_ParamsMappingKeyType , _ParamsMappingValueType ]
8385 | tuple [tuple [_ParamsMappingKeyType , _ParamsMappingValueType ], ...]
8486 | Iterable [tuple [_ParamsMappingKeyType , _ParamsMappingValueType ]]
8587 | str
8688 | bytes
8789 | None
8890 )
8991
90- KVDataType : TypeAlias = Iterable [tuple [Any , Any ]] | Mapping [Any , Any ]
92+ KVDataType : TypeAlias = Iterable [tuple [Any , Any ]] | SupportsItems [Any , Any ]
9193
9294 RawDataType : TypeAlias = KVDataType | str | bytes
9395 StreamDataType : TypeAlias = SupportsRead [str | bytes ]
0 commit comments