Documentation tweaked to omit Python 2.6 distinctions

This commit is contained in:
Daniele Varrazzo 2017-11-28 15:38:27 +00:00
parent 60b1517c55
commit a0229cff82
2 changed files with 12 additions and 14 deletions

View File

@ -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/

View File

@ -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::