Skip to content

Commit dc86509

Browse files
topper-123jreback
authored andcommitted
CLN: remove util._doctools._WritableDoc (#26164)
1 parent 7706741 commit dc86509

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

pandas/core/arrays/interval.py

-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
from pandas._libs.interval import (
99
Interval, IntervalMixin, intervals_to_interval_bounds)
10-
from pandas.compat import add_metaclass
1110
from pandas.compat.numpy import function as nv
1211
from pandas.util._decorators import Appender
13-
from pandas.util._doctools import _WritableDoc
1412

1513
from pandas.core.dtypes.cast import maybe_convert_platform
1614
from pandas.core.dtypes.common import (
@@ -127,7 +125,6 @@
127125
:meth:`IntervalArray.from_breaks`, and :meth:`IntervalArray.from_tuples`.
128126
"""),
129127
))
130-
@add_metaclass(_WritableDoc)
131128
class IntervalArray(IntervalMixin, ExtensionArray):
132129
dtype = IntervalDtype()
133130
ndim = 1

pandas/core/indexes/interval.py

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
from pandas._libs import Timedelta, Timestamp
1010
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
11-
from pandas.compat import add_metaclass
1211
from pandas.util._decorators import Appender, cache_readonly
13-
from pandas.util._doctools import _WritableDoc
1412
from pandas.util._exceptions import rewrite_exception
1513

1614
from pandas.core.dtypes.cast import (
@@ -126,7 +124,6 @@ def _new_IntervalIndex(cls, d):
126124
"""),
127125
128126
))
129-
@add_metaclass(_WritableDoc)
130127
class IntervalIndex(IntervalMixin, Index):
131128
_typ = 'intervalindex'
132129
_comparables = ['name']

pandas/util/_doctools.py

-8
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,6 @@ def _make_table(self, ax, df, title, height=None):
163163
ax.axis('off')
164164

165165

166-
class _WritableDoc(type):
167-
# Remove this when Python2 support is dropped
168-
# __doc__ is not mutable for new-style classes in Python2, which means
169-
# we can't use @Appender to share class docstrings. This can be used
170-
# with `add_metaclass` to make cls.__doc__ mutable.
171-
pass
172-
173-
174166
if __name__ == "__main__":
175167
import matplotlib.pyplot as plt
176168

0 commit comments

Comments
 (0)