From 86198c1c21e959030cf5710a6d4d2fcb3337596b Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 11 Oct 2016 01:33:04 +0100 Subject: [PATCH] inet adapters deprecated Close #343 --- NEWS | 1 + doc/src/extras.rst | 5 +++-- lib/extras.py | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6ada19c0..4921973e 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 78e96efe..3a3d232f 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 fe74d386..a9f5b447 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