docs: add missing __aenter__/__aexit__ docstrings
Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
@@ -14,19 +14,19 @@ datastore trio (`redis` / `psql` / `mysql`), a sibling of the `mongo` lib.
|
||||
`requirements.txt`:
|
||||
|
||||
```
|
||||
redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.0
|
||||
redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.1
|
||||
```
|
||||
|
||||
Direct:
|
||||
|
||||
```bash
|
||||
pip install "redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.0"
|
||||
pip install "redis_store @ git+ssh://git@git.rethinkstudios.io/rethink-public/redis.git@v0.2.1"
|
||||
```
|
||||
|
||||
Pulls `redis>=5.0.1` (redis-py, which ships the asyncio client — **not** the dead standalone
|
||||
`aioredis`; `5.0.1` is the floor because `5.0.0` lacks the async client's `aclose()`).
|
||||
|
||||
Drop the `@v0.2.0` suffix from the line above to install the latest unpinned.
|
||||
Drop the `@v0.2.1` suffix from the line above to install the latest unpinned.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "redis_store"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
description = "async redis wrapper over redis-py asyncio with a raw escape hatch, fail-loud and config-free"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from .redis_store import RedisDB
|
||||
|
||||
__version__ = "0.2.0"
|
||||
__version__ = "0.2.1"
|
||||
|
||||
__all__ = ["RedisDB", "__version__"]
|
||||
|
||||
@@ -108,9 +108,11 @@ class RedisDB:
|
||||
raise
|
||||
|
||||
async def __aenter__(self) -> "RedisDB":
|
||||
"""enter: connect() and return self"""
|
||||
return await self.connect()
|
||||
|
||||
async def __aexit__(self, exc_type, exc, tb) -> None:
|
||||
"""exit: close(), ignoring exc_type/exc/tb"""
|
||||
await self.close()
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user