Skip to content

Commit e6a90a2

Browse files
committed
Added 'not deprecated' note
1 parent f3285fd commit e6a90a2

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

pandas/core/arrays/categorical.py

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class Categorical(ExtensionArray, PandasObject):
309309
# ops, which raise
310310
__array_priority__ = 1000
311311
_dtype = CategoricalDtype(ordered=False)
312+
# tolist is not actually deprecated, just suppressed in the __dir__
312313
_deprecations = frozenset(['labels', 'tolist'])
313314
_typ = 'categorical'
314315

pandas/core/indexes/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class Index(IndexOpsMixin, PandasObject):
203203
>>> pd.Index(list('abc'))
204204
Index(['a', 'b', 'c'], dtype='object')
205205
"""
206+
# tolist is not actually deprecated, just suppressed in the __dir__
206207
_deprecations = DirNamesMixin._deprecations | frozenset(['tolist'])
207208

208209
# To hand over control to subclasses

pandas/core/series.py

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
134134
"""
135135
_metadata = ['name']
136136
_accessors = {'dt', 'cat', 'str', 'sparse'}
137+
# tolist is not actually deprecated, just suppressed in the __dir__
137138
_deprecations = generic.NDFrame._deprecations | frozenset(
138139
['asobject', 'reshape', 'get_value', 'set_value',
139140
'from_csv', 'valid', 'tolist'])

pandas/tests/test_base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,10 @@ def test_iterable_map(self, typ, dtype, rdtype):
11691169
'method',
11701170
[
11711171
lambda x: x.tolist(),
1172+
lambda x: x.to_list(),
11721173
lambda x: list(x),
11731174
lambda x: list(x.__iter__()),
1174-
], ids=['tolist', 'list', 'iter'])
1175+
], ids=['tolist', 'to_list', 'list', 'iter'])
11751176
def test_categorial_datetimelike(self, method):
11761177
i = CategoricalIndex([Timestamp('1999-12-31'),
11771178
Timestamp('2000-12-31')])

0 commit comments

Comments
 (0)