mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-01 21:06:53 +08:00
fix(redis): make xadd fields use SupportsItems (#10780)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import builtins
|
||||
from _typeshed import Incomplete
|
||||
from _typeshed import Incomplete, SupportsItems
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Generic, Literal, TypeVar, overload
|
||||
@@ -862,7 +862,8 @@ class StreamCommands:
|
||||
def xadd(
|
||||
self,
|
||||
name: KeyT,
|
||||
fields: Mapping[bytes | memoryview | str | float, bytes | memoryview | str | float],
|
||||
# Only accepts dict objects, but for variance reasons we use a looser annotation
|
||||
fields: SupportsItems[bytes | memoryview | str | float, Any],
|
||||
id: str | int | bytes | memoryview = "*",
|
||||
maxlen=None,
|
||||
approximate: bool = True,
|
||||
@@ -928,7 +929,8 @@ class AsyncStreamCommands:
|
||||
async def xadd(
|
||||
self,
|
||||
name: KeyT,
|
||||
fields: Mapping[bytes | memoryview | str | float, bytes | memoryview | str | float],
|
||||
# Only accepts dict objects, but for variance reasons we use a looser annotation
|
||||
fields: SupportsItems[bytes | memoryview | str | float, Any],
|
||||
id: str | int | bytes | memoryview = "*",
|
||||
maxlen=None,
|
||||
approximate: bool = True,
|
||||
|
||||
Reference in New Issue
Block a user