summaryrefslogtreecommitdiff
path: root/lib/sql.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-01-03 17:53:02 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-01-03 17:53:02 +0100
commita8a3a298f8ade3b0430ff2df0a5d5ee1fe920e3d (patch)
tree9d16aab52d82ec3bca88fa7da0a38757690e3d9d /lib/sql.py
parent71a168797cc7e6398222490e6de02080de842e1d (diff)
downloadpsycopg2-a8a3a298f8ade3b0430ff2df0a5d5ee1fe920e3d.tar.gz
Autonumbered args not available in Python 2.6
Diffstat (limited to 'lib/sql.py')
-rw-r--r--lib/sql.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sql.py b/lib/sql.py
index e4d4b14..e7d42e6 100644
--- a/lib/sql.py
+++ b/lib/sql.py
@@ -171,7 +171,7 @@ class SQL(Composable):
Example::
- >>> query = sql.SQL("select {} from {}").format(
+ >>> query = sql.SQL("select {0} from {1}").format(
... sql.SQL(', ').join([sql.Identifier('foo'), sql.Identifier('bar')]),
... sql.Identifier('table'))
>>> print(query.as_string(conn))
@@ -202,12 +202,12 @@ class SQL(Composable):
:rtype: `Composed`
The method is similar to the Python `str.format()` method: the string
- template supports auto-numbered (``{}``), numbered (``{0}``,
- ``{1}``...), and named placeholders (``{name}``), with positional
- arguments replacing the numbered placeholders and keywords replacing
- the named ones. However placeholder modifiers (``{0!r}``, ``{0:<10}``)
- are not supported. Only `!Composable` objects can be passed to the
- template.
+ template supports auto-numbered (``{}``, only available from Python
+ 2.7), numbered (``{0}``, ``{1}``...), and named placeholders
+ (``{name}``), with positional arguments replacing the numbered
+ placeholders and keywords replacing the named ones. However placeholder
+ modifiers (``{0!r}``, ``{0:<10}``) are not supported. Only
+ `!Composable` objects can be passed to the template.
Example::