]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: use Self type for connection pool in __*enter__()
authorDenis Laxalde <denis.laxalde@dalibo.com>
Wed, 5 Apr 2023 11:39:53 +0000 (13:39 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 27 Sep 2023 00:40:58 +0000 (02:40 +0200)
commit369108889808b3cbad99d42c1b79f6f0d715bdc7
treed156101b9a3eb6064017ee3066c57ad5fcd674f1
parentc6dae8dbd69ac791075d4d30aea4a1041646a187
fix: use Self type for connection pool in __*enter__()

This makes inheritance, e.g. for *NullConnectionPool, work correctly:

    with psycopg_pool.NullConnectionPool() as p:
        pass
    reveal_type(p)
    # Revealed type is "psycopg_pool.null_pool.NullConnectionPool"
docs/news_pool.rst
psycopg_pool/psycopg_pool/pool.py
psycopg_pool/psycopg_pool/pool_async.py