def _connect(self, key=None):
    "Create a new connection and assign it to 'key' if not None."
    conn = psycopg2.connect(*self._args, **self._kwargs)
    if (key is not None):
        self._used[key] = conn
        self._rused[id(conn)] = key
    else:
        self._pool.append(conn)
    return conn
Create a new connection and assign it to 'key' if not None.
def _connect(self, key=None):
    
    conn = psycopg2.connect(*self._args, **self._kwargs)
    if (key is not None):
        self._used[key] = conn
        self._rused[id(conn)] = key
    else:
        self._pool.append(conn)
    return conn