summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-10-11 01:33:04 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2016-10-11 02:17:56 +0100
commit86198c1c21e959030cf5710a6d4d2fcb3337596b (patch)
tree89490409143cc584d118bbd9619d9b8fb4f8f0fd
parent05627ac0f9e519c52014185b48a782f8669e6843 (diff)
downloadpsycopg2-86198c1c21e959030cf5710a6d4d2fcb3337596b.tar.gz
inet adapters deprecated
Close #343
-rw-r--r--NEWS1
-rw-r--r--doc/src/extras.rst5
-rw-r--r--lib/extras.py5
3 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6ada19c..4921973 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ New features:
- The attributes `~connection.notices` and `~connection.notifies` can be
customized replacing them with any object exposing an `!append()` method
(:ticket:`#326`).
+- old ``inet`` adapters deprecated (:ticket:`#343`).
- Added `~psycopg2.extensions.quote_ident()` function (:ticket:`#359`).
- Added `~connection.get_dsn_parameters()` connection method (:ticket:`#364`).
diff --git a/doc/src/extras.rst b/doc/src/extras.rst
index 78e96ef..3a3d232 100644
--- a/doc/src/extras.rst
+++ b/doc/src/extras.rst
@@ -934,8 +934,9 @@ UUID data type
:sql:`inet` data type
^^^^^^^^^^^^^^^^^^^^^^
-.. versionadded:: 2.0.9
-.. versionchanged:: 2.4.5 added inet array support.
+.. deprecated:: 2.7
+ these objects will not receive further development and disappear in future
+ versions
.. doctest::
diff --git a/lib/extras.py b/lib/extras.py
index fe74d38..a9f5b44 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -686,6 +686,11 @@ def register_inet(oid=None, conn_or_curs=None):
:param conn_or_curs: where to register the typecaster. If not specified,
register it globally.
"""
+ import warnings
+ warnings.warn(
+ "the inet adapter is deprecated, it's not very useful",
+ DeprecationWarning)
+
if not oid:
oid1 = 869
oid2 = 1041