From a0229cff8252c07eddf22626a65e3f2967e2b037 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 28 Nov 2017 15:38:27 +0000 Subject: [PATCH] Documentation tweaked to omit Python 2.6 distinctions --- doc/src/usage.rst | 14 ++++++-------- lib/sql.py | 12 ++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/src/usage.rst b/doc/src/usage.rst index 79823b11..5dcab8fe 100644 --- a/doc/src/usage.rst +++ b/doc/src/usage.rst @@ -457,14 +457,12 @@ the connection or globally: see the function Binary adaptation ^^^^^^^^^^^^^^^^^ -Python types representing binary objects are converted into -PostgreSQL binary string syntax, suitable for :sql:`bytea` fields. Such -types are `buffer` (only available in Python 2), `memoryview` (available -from Python 2.7), `bytearray` (available from Python 2.6) and `bytes` -(only from Python 3: the name is available from Python 2.6 but it's only an -alias for the type `!str`). Any object implementing the `Revised Buffer -Protocol`__ should be usable as binary type where the protocol is supported -(i.e. from Python 2.6). Received data is returned as `!buffer` (in Python 2) +Python types representing binary objects are converted into PostgreSQL binary +string syntax, suitable for :sql:`bytea` fields. Such types are `buffer` +(only available in Python 2), `memoryview`, `bytearray`, and `bytes` (only in +Python 3: the name is available in Python 2 but it's only an alias for the +type `!str`). Any object implementing the `Revised Buffer Protocol`__ should +be usable as binary type. Received data is returned as `!buffer` (in Python 2) or `!memoryview` (in Python 3). .. __: http://www.python.org/dev/peps/pep-3118/ diff --git a/lib/sql.py b/lib/sql.py index d89e1176..5dfe7c8b 100644 --- a/lib/sql.py +++ b/lib/sql.py @@ -203,12 +203,12 @@ class SQL(Composable): :rtype: `Composed` The method is similar to the Python `str.format()` method: the string - 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. + 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. Example::