inet adapters deprecated

Close #343
This commit is contained in:
Daniele Varrazzo 2016-10-11 01:33:04 +01:00
parent 05627ac0f9
commit 86198c1c21
3 changed files with 9 additions and 2 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ New features:
- The attributes `~connection.notices` and `~connection.notifies` can be - The attributes `~connection.notices` and `~connection.notifies` can be
customized replacing them with any object exposing an `!append()` method customized replacing them with any object exposing an `!append()` method
(:ticket:`#326`). (:ticket:`#326`).
- old ``inet`` adapters deprecated (:ticket:`#343`).
- Added `~psycopg2.extensions.quote_ident()` function (:ticket:`#359`). - Added `~psycopg2.extensions.quote_ident()` function (:ticket:`#359`).
- Added `~connection.get_dsn_parameters()` connection method (:ticket:`#364`). - Added `~connection.get_dsn_parameters()` connection method (:ticket:`#364`).

View File

@ -934,8 +934,9 @@ UUID data type
:sql:`inet` data type :sql:`inet` data type
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
.. versionadded:: 2.0.9 .. deprecated:: 2.7
.. versionchanged:: 2.4.5 added inet array support. these objects will not receive further development and disappear in future
versions
.. doctest:: .. doctest::

View File

@ -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, :param conn_or_curs: where to register the typecaster. If not specified,
register it globally. register it globally.
""" """
import warnings
warnings.warn(
"the inet adapter is deprecated, it's not very useful",
DeprecationWarning)
if not oid: if not oid:
oid1 = 869 oid1 = 869
oid2 = 1041 oid2 = 1041