CLN: De-privatize core.common funcs, remove unused
State: closed

Moves a few console-checking functions to `io.formats.console`.

A bunch of core.common functions were never used outside of tests, got rid of em.

The ones I left alone were _any_not_none, _all_not_none etc, as I'm inclined to think these should be removed in favor of python builtins.

Labels:
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22001?src=pr&el=h1) Report
> Merging [#22001](https://codecov.io/gh/pandas-dev/pandas/pull/22001?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/171076cc4f37af3f1d050237d0aa3e8000d2bca3?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `90.67%`.

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

```diff
@@            Coverage Diff             @@
##           master   #22001      +/-   ##
==========================================
- Coverage      92%      92%   -0.01%     
==========================================
  Files         170      170              
  Lines       50609    50551      -58     
==========================================
- Hits        46561    46507      -54     
+ Misses       4048     4044       -4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.4% <89.63%> (-0.01%)` | :arrow_down: |
| #single | `42.21% <44.55%> (+0.02%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22001?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.48% <0%> (ø)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `96.11% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9udW1lcmljLnB5) | `97.24% <100%> (ø)` | :arrow_up: |
| [pandas/core/strings.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3RyaW5ncy5weQ==) | `98.63% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.95% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9pbnRlcnZhbC5weQ==) | `94.12% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9hcGkucHk=) | `98.91% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.37% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/category.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9jYXRlZ29yeS5weQ==) | `97.28% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.12% <100%> (ø)` | :arrow_up: |
| ... and [34 more](https://codecov.io/gh/pandas-dev/pandas/pull/22001/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22001?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/22001?src=pr&el=footer). Last update [171076c...8e5a1bd](https://codecov.io/gh/pandas-dev/pandas/pull/22001?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hello @jbrockmendel! Thanks for updating the PR.











































































 - In the file [`pandas/io/formats/console.py`](https://github.com/pandas-dev/pandas/blob/00ba0d0d089d4d437783c1ae216c3011cb209b24/pandas/io/formats/console.py), following are the PEP8 issues :

> [Line 103:5](https://github.com/pandas-dev/pandas/blob/00ba0d0d089d4d437783c1ae216c3011cb209b24/pandas/io/formats/console.py#L103): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'
> [Line 121:5](https://github.com/pandas-dev/pandas/blob/00ba0d0d089d4d437783c1ae216c3011cb209b24/pandas/io/formats/console.py#L121): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'
> [Line 140:5](https://github.com/pandas-dev/pandas/blob/00ba0d0d089d4d437783c1ae216c3011cb209b24/pandas/io/formats/console.py#L140): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'
> [Line 152:5](https://github.com/pandas-dev/pandas/blob/00ba0d0d089d4d437783c1ae216c3011cb209b24/pandas/io/formats/console.py#L152): [E722](https://duckduckgo.com/?q=pep8%20E722) do not use bare except'

























##### Comment last updated on July 24, 2018 at 04:05 Hours UTC
note ``pandas.core.common`` is technically public. We never made explicity made this non-public, so have to be careful about name changes here. I find these ok, but in the longer term we should probably change this.
> note pandas.core.common is technically public. We never made explicity made this non-public, so have to be careful about name changes here.

Ah, yes, that's a good point. The ones we previously moved out we deprecated explicitly. 

I don't think it would be too hard to deprecate all the renamed functions? (create the old ones calling the the new one + with added deprecation warning in a loop?)
I'm unclear on how to move forward.  If core.common is public, does that mean we need to not-remove the (deprecated) environment-detecting and other unused functions?  Do we need to wrap+expose the currently-private functions?
I think we *only* need to care about the changed non-private functions (e.g. no leading _). 

Its fair game to move all of the console functions, as well as remove the unused functions. I don't think we should go crazy with deprecations. Maybe just add a blanket whatsnew. We only deprecated things because these were *very* commonly used function, all of the ``is_*`` ones (which moved to pandas.api.types).

I will have another look and indicate anything we actually need to deprecate.
I am actually ok with these changes as-if (just add a whatsnew note). And add a disclaimer on the doc-string that this is a non-public module.

we long ago declared the ``pandas.core`` namespace private (it would break too much to actually change this to ``panda._core``, though maybe we should actually do that.
thanks @jbrockmendel