diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt index 025ac7673622b..b6feb5cf8cedd 100644 --- a/doc/source/whatsnew/v0.20.0.txt +++ b/doc/source/whatsnew/v0.20.0.txt @@ -1246,7 +1246,7 @@ these are now the public subpackages. - The function :func:`~pandas.api.types.union_categoricals` is now importable from ``pandas.api.types``, formerly from ``pandas.types.concat`` (:issue:`15998`) - +- The type import ``pandas.tslib.NaTType`` is deprecated and can be replaced by using ``type(pandas.NaT)`` (:issue:`16146`) .. _whatsnew_0200.privacy.errors: diff --git a/pandas/__init__.py b/pandas/__init__.py index 43fa362b66ed5..20c7e0d9d5993 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -77,6 +77,7 @@ moved={'Timestamp': 'pandas.Timestamp', 'Timedelta': 'pandas.Timedelta', 'NaT': 'pandas.NaT', + 'NaTType': 'type(pandas.NaT)', 'OutOfBoundsDatetime': 'pandas.errors.OutOfBoundsDatetime'}) # use the closest tagged version if possible diff --git a/pandas/tslib.py b/pandas/tslib.py index f7d99538c2ea2..c960a4eaf59ad 100644 --- a/pandas/tslib.py +++ b/pandas/tslib.py @@ -4,4 +4,4 @@ warnings.warn("The pandas.tslib module is deprecated and will be " "removed in a future version.", FutureWarning, stacklevel=2) from pandas._libs.tslib import (Timestamp, Timedelta, - NaT, OutOfBoundsDatetime) + NaT, NaTType, OutOfBoundsDatetime)