]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Result.__enter__ annotation
authorMartin Baláž <embeembe@gmail.com>
Sat, 21 Jan 2023 13:56:14 +0000 (14:56 +0100)
committerGitHub <noreply@github.com>
Sat, 21 Jan 2023 13:56:14 +0000 (14:56 +0100)
commitcf0a4fc812cf4d14011a021e26b9f9f6ab3813fc
tree83b35cf4b81546bf041ee851d1c4ee23753a2105
parent2f91dd79310657814ad28b6ef64f91fff7a007c9
Result.__enter__ annotation

Improved `Result.__enter__()` annotation.
When using `Result` subclasses (like for example `CursorResult`) as context managers, better annotation is derived.
For example:
```python
with connection.execute(statement) as result:  # result is `CursorResult` instead of just `Result`
    pass
```
lib/sqlalchemy/engine/result.py