mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Documentation tweaked to omit Python 2.6 distinctions
This commit is contained in:
parent
60b1517c55
commit
a0229cff82
|
@ -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/
|
||||
|
|
12
lib/sql.py
12
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::
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user