Skip to content

Commit e9ad2a3

Browse files
authored
Fix for lpop and rpop return typing (#2590)
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 e9ad2a3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

redis/commands/core.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,7 +2667,11 @@ 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,
2672+
name: str,
2673+
count: Optional[int] = None,
2674+
) -> Union[Awaitable[Union[str, List, None]], Union[str, List, None]]:
26712675
"""
26722676
Removes and returns the first elements of the list ``name``.
26732677
@@ -2744,7 +2748,11 @@ def ltrim(self, name: str, start: int, end: int) -> Union[Awaitable[str], str]:
27442748
"""
27452749
return self.execute_command("LTRIM", name, start, end)
27462750

2747-
def rpop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]:
2751+
def rpop(
2752+
self,
2753+
name: str,
2754+
count: Optional[int] = None,
2755+
) -> Union[Awaitable[Union[str, List, None]], Union[str, List, None]]:
27482756
"""
27492757
Removes and returns the last elements of the list ``name``.
27502758

0 commit comments

Comments
 (0)