Add NaTType to tslib public api
State: closed

When testing the new `0.20.0` release candidate I found that the removal of `NaTType`  from the `tslib` public api breaks `odo`.

If this api breakage is actually intentional/desired I'm ok with this being closed however it should probably get a mention in the backwards incompatible API changes section of the whatsnew.

Whilst a deprecation warning is raised in https://github.com/pandas-dev/pandas/commit/648ae4f03622d8eafe1ca3b833bd6a99f56bece4#diff-d6b2c5dbe1e7fbda4ed4b87e0c49399f the removal of NaTType breaks the previous public api rendering the warning ineffective and not giving any 3rd party libraries a chance to make the necessary changes and cut a release

Labels:
name: API Design

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=h1) Report
> Merging [#16137](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d50b1620ca57a37c0c005ae946b9fc45020e2155?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/16137/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #16137   +/-   ##
=======================================
  Coverage   90.84%   90.84%           
=======================================
  Files         159      159           
  Lines       50779    50779           
=======================================
  Hits        46128    46128           
  Misses       4651     4651
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.62% <ø> (ø)` | :arrow_up: |
| #single | `40.33% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tslib.py](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree#diff-cGFuZGFzL3RzbGliLnB5) | `100% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=footer). Last update [d50b162...06eafff](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=h1) Report
> Merging [#16137](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d50b1620ca57a37c0c005ae946b9fc45020e2155?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/16137/graphs/tree.svg?token=eZ4WkYLtcO&src=pr&height=150&width=650)](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #16137   +/-   ##
=======================================
  Coverage   90.84%   90.84%           
=======================================
  Files         159      159           
  Lines       50779    50779           
=======================================
  Hits        46128    46128           
  Misses       4651     4651
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.62% <ø> (ø)` | :arrow_up: |
| #single | `40.33% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tslib.py](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=tree#diff-cGFuZGFzL3RzbGliLnB5) | `100% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=footer). Last update [d50b162...06eafff](https://codecov.io/gh/pandas-dev/pandas/pull/16137?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

NaTType was never a public api
who/what is using this?
odo was using that
We could maybe expose `NaTType` in `pandas.api.types` ?
Depending on what we decide (whether we find it worth to expose `NaTType` publicly or not), you also have to adapt `__init__.py` here: https://github.com/pandas-dev/pandas/blob/master/pandas/__init__.py#L76 to provide the correct deprecation message.
It would be ok for `odo` to use a private attribute if they're aware that it is meant to be private which the new import from `pd._libs.tslib` would indicate.

It would be nice I guess if they didn't have to though so I'd be in favour of exposing it in `pd.api.types`.
superseded by #16146 
The right way to use this going forward is probably `type(pd.NaT)`. I'm not sure what the point of exposing `NaTType` is, given that it's a singleton. Python 2 had `types.NoneType` but they removed it in Python 3.