mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +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
|
Binary adaptation
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Python types representing binary objects are converted into
|
Python types representing binary objects are converted into PostgreSQL binary
|
||||||
PostgreSQL binary string syntax, suitable for :sql:`bytea` fields. Such
|
string syntax, suitable for :sql:`bytea` fields. Such types are `buffer`
|
||||||
types are `buffer` (only available in Python 2), `memoryview` (available
|
(only available in Python 2), `memoryview`, `bytearray`, and `bytes` (only in
|
||||||
from Python 2.7), `bytearray` (available from Python 2.6) and `bytes`
|
Python 3: the name is available in Python 2 but it's only an alias for the
|
||||||
(only from Python 3: the name is available from Python 2.6 but it's only an
|
type `!str`). Any object implementing the `Revised Buffer Protocol`__ should
|
||||||
alias for the type `!str`). Any object implementing the `Revised Buffer
|
be usable as binary type. Received data is returned as `!buffer` (in Python 2)
|
||||||
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)
|
|
||||||
or `!memoryview` (in Python 3).
|
or `!memoryview` (in Python 3).
|
||||||
|
|
||||||
.. __: http://www.python.org/dev/peps/pep-3118/
|
.. __: 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`
|
:rtype: `Composed`
|
||||||
|
|
||||||
The method is similar to the Python `str.format()` method: the string
|
The method is similar to the Python `str.format()` method: the string
|
||||||
template supports auto-numbered (``{}``, only available from Python
|
template supports auto-numbered (``{}``), numbered (``{0}``,
|
||||||
2.7), numbered (``{0}``, ``{1}``...), and named placeholders
|
``{1}``...), and named placeholders (``{name}``), with positional
|
||||||
(``{name}``), with positional arguments replacing the numbered
|
arguments replacing the numbered placeholders and keywords replacing
|
||||||
placeholders and keywords replacing the named ones. However placeholder
|
the named ones. However placeholder modifiers (``{0!r}``, ``{0:<10}``)
|
||||||
modifiers (``{0!r}``, ``{0:<10}``) are not supported. Only
|
are not supported. Only `!Composable` objects can be passed to the
|
||||||
`!Composable` objects can be passed to the template.
|
template.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user