Skip to content

Commit 800805a

Browse files
authored
Fix for lpop and rpop return typing
Right now there is an annoying warning that these methods can't be awaited when using `redis.asyncio`, even tho it does work with no problems.
1 parent fd7a79d commit 800805a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

redis/commands/core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,7 +2667,9 @@ def llen(self, name: str) -> Union[Awaitable[int], int]:
26672667
"""
26682668
return self.execute_command("LLEN", name)
26692669

2670-
def lpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]:
2670+
def lpop(
2671+
self, name: str, count: Optional[int] = None,
2672+
) -> Union[Awaitable[Union[str, List, None]], Union[str, List, None]]:
26712673
"""
26722674
Removes and returns the first elements of the list ``name``.
26732675
@@ -2744,7 +2746,9 @@ def ltrim(self, name: str, start: int, end: int) -> Union[Awaitable[str], str]:
27442746
"""
27452747
return self.execute_command("LTRIM", name, start, end)
27462748

2747-
def rpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]:
2749+
def rpop(
2750+
self, name: str, count: Optional[int] = None,
2751+
) -> Union[Awaitable[Union[str, List, None]], Union[str, List, None]]:
27482752
"""
27492753
Removes and returns the last elements of the list ``name``.
27502754

0 commit comments

Comments
 (0)