summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2022-10-20 21:31:18 +0200
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2022-10-20 21:31:18 +0200
commitf401d0b738e05911b2a97a933b36fcbf23aba4d2 (patch)
tree617abffe353cef73ef1a1d78f90cf893007023be
parentaabac5df31a764b812f6113a1b18d18974a61768 (diff)
downloadpsycopg2-f401d0b738e05911b2a97a933b36fcbf23aba4d2.tar.gz
docs: fix reST syntax and whitespace in executemany examples
-rw-r--r--doc/src/cursor.rst6
-rw-r--r--doc/src/extras.rst12
2 files changed, 11 insertions, 7 deletions
diff --git a/doc/src/cursor.rst b/doc/src/cursor.rst
index b5b2990..a998b3c 100644
--- a/doc/src/cursor.rst
+++ b/doc/src/cursor.rst
@@ -207,10 +207,12 @@ The ``cursor`` class
Parameters are bounded to the query using the same rules described in
the `~cursor.execute()` method.
-
+
+ .. code:: python
+
>>> nums = ((1,), (5,), (10,))
>>> cur.executemany("INSERT INTO test (num) VALUES (%s)", nums)
-
+
>>> tuples = ((123, "foo"), (42, "bar"), (23, "baz"))
>>> cur.executemany("INSERT INTO test (num, data) VALUES (%s, %s)", tuples)
diff --git a/doc/src/extras.rst b/doc/src/extras.rst
index 30c8a6b..083379b 100644
--- a/doc/src/extras.rst
+++ b/doc/src/extras.rst
@@ -1029,11 +1029,13 @@ parameters. By reducing the number of server roundtrips the performance can be
.. autofunction:: execute_batch
- >>> nums = ((1,), (5,), (10,))
- >>> execute_batch(cur, "INSERT INTO test (num) VALUES (%s)", nums)
-
- >>> tuples = ((123, "foo"), (42, "bar"), (23, "baz"))
- >>> execute_batch(cur, "INSERT INTO test (num, data) VALUES (%s, %s)", tuples)
+ .. code:: python
+
+ >>> nums = ((1,), (5,), (10,))
+ >>> execute_batch(cur, "INSERT INTO test (num) VALUES (%s)", nums)
+
+ >>> tuples = ((123, "foo"), (42, "bar"), (23, "baz"))
+ >>> execute_batch(cur, "INSERT INTO test (num, data) VALUES (%s, %s)", tuples)
.. versionadded:: 2.7