CLN (PY2): Remove DataFrame/Series.timetuple
State: closed

I was looking at the sphinx doc build warnings, and of them was complaining about the `DataFrame/Series.timetuple` attribute. This dummy `timetuple` attribute was added in https://github.com/pandas-dev/pandas/pull/24056, to fix comparison with `datetime.datetime`. 

Apart from the doc build problem (which can probably be fixed in another way as well), this also adds yet another (and for the rest useless / undocumented) attribute to our main classes.

But from a quick test (at least on linux with python 3.7, with Series) this is not needed to make it work. So removing again to see what travis/azure say.

@jbrockmendel do you remember the context of adding this?

Labels:
name: Clean

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

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

```diff
@@            Coverage Diff             @@
##           master   #26062      +/-   ##
==========================================
- Coverage    91.9%   91.89%   -0.01%     
==========================================
  Files         175      175              
  Lines       52485    52484       -1     
==========================================
- Hits        48234    48230       -4     
- Misses       4251     4254       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.74% <ø> (-0.15%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26062?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `93.54% <ø> (-0.01%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/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/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.72% <0%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26062?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/26062?src=pr&el=footer). Last update [a07ed59...accbbfe](https://codecov.io/gh/pandas-dev/pandas/pull/26062?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/26062?src=pr&el=h1) Report
> Merging [#26062](https://codecov.io/gh/pandas-dev/pandas/pull/26062?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a07ed594ec6a5befc967fb1b18244bbeb3bc2bf1?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #26062      +/-   ##
==========================================
- Coverage    91.9%   91.89%   -0.01%     
==========================================
  Files         175      175              
  Lines       52485    52506      +21     
==========================================
+ Hits        48234    48249      +15     
- Misses       4251     4257       +6
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.73% <ø> (-0.16%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26062?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.4% <ø> (-0.01%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.79% <ø> (-0.01%)` | :arrow_down: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `93.54% <ø> (-0.01%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/sparse/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL2ZyYW1lLnB5) | `95.5% <0%> (-0.2%)` | :arrow_down: |
| [pandas/compat/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvbXBhdC9fX2luaXRfXy5weQ==) | `77.5% <0%> (-0.15%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |
| [pandas/plotting/\_core.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb3JlLnB5) | `83.77% <0%> (-0.09%)` | :arrow_down: |
| [pandas/core/dtypes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Jhc2UucHk=) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/computation/expr.py](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vZXhwci5weQ==) | `96.7% <0%> (ø)` | :arrow_up: |
| ... and [6 more](https://codecov.io/gh/pandas-dev/pandas/pull/26062/diff?src=pr&el=tree-more) | |

------

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

> do you remember the context of adding this?

I was under the impression that it was needed in order to get `datetime.__op__(other)` to return `NotImplemented`.  If that impression was incorrect, then this may not be needed.
```
In [1]: import datetime                                                                                                                                       

In [2]: dt = datetime.datetime(2012, 1, 1)                                                                                                                    

In [3]: s = pd.Series([dt, dt + datetime.timedelta(1)])                                                                                                       

In [4]: dt.__eq__(s)                                                                                                                                          
Out[4]: NotImplemented
```

On this branch (so without the attribute), but in a single env of course.

But I assume that you added tests for it in the original PR, so if the tests are green, we can rely on that?

btw i think was needed for PY2 as that attribute was looked for
Ah, that might be a good reason that CI is green now
Yes, can confirm that in Python 2 it was needed:

```
In [1]: import datetime

In [2]: dt = datetime.datetime(2012, 1, 1)

In [3]: s = pd.Series([dt, dt + datetime.timedelta(1)])

In [4]: dt == s
Out[4]: False

In [5]: pd.Series.timetuple=None

In [6]: s = pd.Series([dt, dt + datetime.timedelta(1)])

In [7]: dt == s
Out[7]: 
0     True
1    False
dtype: bool

```

Then we can remove it now. I think there are some other occurrences as well (on the arrays), let me check for that.
thanks @jorisvandenbossche