12
12
3.2, and 3.3. We don't yet have a testing matrix for different versions of
13
13
:py:mod:`psycopg2` or PostgreSQL.
14
14
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
-
19
15
:py:mod:`postgres` is in the `public domain`_.
20
16
21
17
@@ -219,8 +215,16 @@ class Postgres(object):
219
215
220
216
This is the main object that :py:mod:`postgres` provides, and you should
221
217
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
224
228
<http://initd.org/psycopg/docs/pool.html#psycopg2.pool.ThreadedConnectionPool>`_,
225
229
which opens :py:attr:`minconn` connections immediately, and up to
226
230
:py:attr:`maxconn` according to demand. The fundamental value of a
@@ -247,9 +251,6 @@ class Postgres(object):
247
251
simple API (:py:meth:`~postgres.Postgres.run` /
248
252
:py:meth:`~postgres.Postgres.one` / :py:meth:`~postgres.Postgres.rows`).
249
253
250
- >>> import postgres
251
- >>> db = postgres.Postgres("postgres://jrandom@localhost/test")
252
-
253
254
.. _this ticket: https://github.com/gittip/postgres.py/issues/16
254
255
255
256
"""
0 commit comments