Files
typeshed/stubs/redis
Christopher Dignam 93e2806232 [redis] add overload for blpop and brpop timeout (#4998)
0 is the default value for the timeout argument for both blpop and brpop. When the timeout is `0`, the return type is non-nullable. Otherwise the return type is optional.

I tested my change with the following code
```python
from typing import Optional, Tuple
import redis

def test_blpop_timeout(r: redis.Redis) -> None:
    a: Tuple[bytes, bytes] = r.blpop('')
    b: Tuple[bytes, bytes] = r.blpop('',timeout=0)
    c: Optional[Tuple[bytes, bytes]] = r.blpop('', timeout=1)
    d: Optional[Tuple[bytes, bytes]] = r.blpop('', timeout=1.0)

def test_brpop_timeout(r: redis.Redis) -> None:
    a: Tuple[bytes, bytes] = r.brpop('')
    b: Tuple[bytes, bytes] = r.brpop('',timeout=0)
    c: Optional[Tuple[bytes, bytes]] = r.brpop('', timeout=1)
    d: Optional[Tuple[bytes, bytes]] = r.brpop('', timeout=1.0)
```
2021-02-04 20:32:34 -08:00
..