CLN: Misc PY2/3 compat functions
State: closed

- [x] xref #25725
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

- Import `from pandas.compat.chainmap import DeepChainMap` directly where used
- Removed `isidentifier`, `str_to_bytes`, `bytes_to_str`, `bind_method`

Labels:
name: Clean

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

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

```diff
@@            Coverage Diff             @@
##           master   #26008      +/-   ##
==========================================
+ Coverage   91.82%   91.83%   +<.01%     
==========================================
  Files         175      175              
  Lines       52551    52531      -20     
==========================================
- Hits        48256    48240      -16     
+ Misses       4295     4291       -4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.39% <100%> (+0.01%)` | :arrow_up: |
| #single | `40.72% <66.66%> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26008?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/clipboards.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NsaXBib2FyZHMucHk=) | `100% <ø> (ø)` | :arrow_up: |
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `79.2% <100%> (+3.37%)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `91.72% <100%> (-0.02%)` | :arrow_down: |
| [pandas/core/computation/scope.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vc2NvcGUucHk=) | `93.13% <100%> (ø)` | :arrow_up: |
| [pandas/core/computation/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vcHl0YWJsZXMucHk=) | `90.24% <100%> (ø)` | :arrow_up: |
| [pandas/io/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NvbW1vbi5weQ==) | `91.87% <100%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `93.54% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26008?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/26008?src=pr&el=footer). Last update [a1fee91...598f415](https://codecov.io/gh/pandas-dev/pandas/pull/26008?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/26008?src=pr&el=h1) Report
> Merging [#26008](https://codecov.io/gh/pandas-dev/pandas/pull/26008?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/0610a60d06c190cdd597480962f98b97de7b4286?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #26008      +/-   ##
==========================================
+ Coverage   91.82%   91.83%   +<.01%     
==========================================
  Files         175      175              
  Lines       52540    52517      -23     
==========================================
- Hits        48247    48228      -19     
+ Misses       4293     4289       -4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.39% <100%> (+0.01%)` | :arrow_up: |
| #single | `40.72% <66.66%> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26008?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/clipboards.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NsaXBib2FyZHMucHk=) | `100% <ø> (ø)` | :arrow_up: |
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `77.9% <100%> (+3.37%)` | :arrow_up: |
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `91.72% <100%> (-0.02%)` | :arrow_down: |
| [pandas/core/computation/scope.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vc2NvcGUucHk=) | `93.13% <100%> (ø)` | :arrow_up: |
| [pandas/core/computation/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vcHl0YWJsZXMucHk=) | `90.24% <100%> (ø)` | :arrow_up: |
| [pandas/io/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2NvbW1vbi5weQ==) | `91.83% <100%> (-0.05%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `93.54% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26008/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |

------

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

can you merge master
@jreback rebased+green
I think these are flaky tests. They pass locally for me and don't relate to changes this PR makes. 

```
_ TestCategoricalSeriesAnalytics.test_drop_duplicates_categorical_non_bool[True-datetime64[D]] _
[gw1] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
[XPASS(strict)] GH#7996
_ TestCategoricalSeriesAnalytics.test_drop_duplicates_categorical_non_bool[False-datetime64[D]] _
[gw1] linux -- Python 3.6.6 /home/travis/miniconda3/envs/pandas-dev/bin/python
[XPASS(strict)] GH#7996
```
yeah have seen these and can’t repro either
thanks @mroeschke