mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Move abstract methods to AbstractConnectionPool (#6340)
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
psycopg2.connection
|
||||
psycopg2.cursor
|
||||
psycopg2.pool.AbstractConnectionPool.closeall
|
||||
psycopg2.pool.AbstractConnectionPool.getconn
|
||||
psycopg2.pool.AbstractConnectionPool.putconn
|
||||
|
||||
@@ -9,14 +9,15 @@ class AbstractConnectionPool:
|
||||
maxconn: Any
|
||||
closed: bool
|
||||
def __init__(self, minconn, maxconn, *args, **kwargs) -> None: ...
|
||||
# getconn, putconn and closeall are officially documented as methods of the
|
||||
# abstract base class, but in reality, they only exist on the children classes
|
||||
def getconn(self, key: Any | None = ...): ...
|
||||
def putconn(self, conn: Any, key: Any | None = ..., close: bool = ...) -> None: ...
|
||||
def closeall(self) -> None: ...
|
||||
|
||||
class SimpleConnectionPool(AbstractConnectionPool):
|
||||
getconn: Any
|
||||
putconn: Any
|
||||
closeall: Any
|
||||
class SimpleConnectionPool(AbstractConnectionPool): ...
|
||||
|
||||
class ThreadedConnectionPool(AbstractConnectionPool):
|
||||
def __init__(self, minconn, maxconn, *args, **kwargs) -> None: ...
|
||||
def getconn(self, key: Any | None = ...): ...
|
||||
# This subclass has a default value for conn which doesn't exist
|
||||
# in the SimpleConnectionPool class, nor in the documentation
|
||||
def putconn(self, conn: Any | None = ..., key: Any | None = ..., close: bool = ...) -> None: ...
|
||||
def closeall(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user