Skip to content

Commit d4d1637

Browse files
committed
Move import notice out of Installation
1 parent 14cb8ee commit d4d1637

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

postgres.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
3.2, and 3.3. We don't yet have a testing matrix for different versions of
1313
:py:mod:`psycopg2` or PostgreSQL.
1414
15-
Importing :py:mod:`postgres` under Python 2 will cause the registration of
16-
typecasters with :py:mod:`psycopg2` to ensure that you get unicode instead of
17-
bytestrings for text data, according to `this advice`_.
18-
1915
:py:mod:`postgres` is in the `public domain`_.
2016
2117
@@ -219,8 +215,16 @@ class Postgres(object):
219215
220216
This is the main object that :py:mod:`postgres` provides, and you should
221217
have one instance per process for each PostgreSQL database your process
222-
wants to talk to using this library. When instantiated, this object creates
223-
a `thread-safe connection pool
218+
wants to talk to using this library.
219+
220+
>>> import postgres
221+
>>> db = postgres.Postgres("postgres://jrandom@localhost/test")
222+
223+
(Note that importing :py:mod:`postgres` under Python 2 will cause the
224+
registration of typecasters with :py:mod:`psycopg2` to ensure that you get
225+
unicode instead of bytestrings for text data, according to `this advice`_.)
226+
227+
When instantiated, this object creates a `thread-safe connection pool
224228
<http://initd.org/psycopg/docs/pool.html#psycopg2.pool.ThreadedConnectionPool>`_,
225229
which opens :py:attr:`minconn` connections immediately, and up to
226230
:py:attr:`maxconn` according to demand. The fundamental value of a
@@ -247,9 +251,6 @@ class Postgres(object):
247251
simple API (:py:meth:`~postgres.Postgres.run` /
248252
:py:meth:`~postgres.Postgres.one` / :py:meth:`~postgres.Postgres.rows`).
249253
250-
>>> import postgres
251-
>>> db = postgres.Postgres("postgres://jrandom@localhost/test")
252-
253254
.. _this ticket: https://github.com/gittip/postgres.py/issues/16
254255
255256
"""

0 commit comments

Comments
 (0)