From: Daniele Varrazzo Date: Sun, 14 Nov 2021 17:41:33 +0000 (+0100) Subject: Drop unneeded 'cursor()' in docs X-Git-Tag: 3.0.4~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e4689522327631772f931d9b8ac0917f4b54895;p=thirdparty%2Fpsycopg.git Drop unneeded 'cursor()' in docs --- diff --git a/docs/advanced/async.rst b/docs/advanced/async.rst index a6d4045f1..6d33b88da 100644 --- a/docs/advanced/async.rst +++ b/docs/advanced/async.rst @@ -147,7 +147,7 @@ the ``stop`` message is received. import psycopg conn = psycopg.connect("", autocommit=True) - conn.cursor().execute("LISTEN mychan") + conn.execute("LISTEN mychan") gen = conn.notifies() for notify in gen: print(notify) @@ -187,7 +187,7 @@ received immediately, but only during a connection operation, such as a query. # =# notify mychan, 'hey'; # NOTIFY - print(conn.cursor().execute("SELECT 1").fetchone()) + print(conn.execute("SELECT 1").fetchone()) # got this: Notify(channel='mychan', payload='hey', pid=961823) # (1,)