From f401d0b738e05911b2a97a933b36fcbf23aba4d2 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 20 Oct 2022 21:31:18 +0200 Subject: docs: fix reST syntax and whitespace in executemany examples --- doc/src/cursor.rst | 6 ++++-- doc/src/extras.rst | 12 +++++++----- 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 -- cgit v1.2.1