Skip to content

Commit 63a1122

Browse files
committed
Added 'not deprecated' note
1 parent bf2cf35 commit 63a1122

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

pandas/core/arrays/categorical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class Categorical(ExtensionArray, PandasObject):
323323
# ops, which raise
324324
__array_priority__ = 1000
325325
_dtype = CategoricalDtype(ordered=False)
326+
# tolist is not actually deprecated, just suppressed in the __dir__
326327
_deprecations = frozenset(['labels', 'tolist'])
327328
_typ = 'categorical'
328329

pandas/core/indexes/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ class Index(IndexOpsMixin, PandasObject):
220220
DatetimeIndex, TimedeltaIndex, PeriodIndex
221221
Int64Index, UInt64Index, Float64Index
222222
"""
223+
# tolist is not actually deprecated, just suppressed in the __dir__
223224
_deprecations = DirNamesMixin._deprecations | frozenset(['tolist'])
224225

225226
# To hand over control to subclasses

pandas/core/series.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
144144
"""
145145
_metadata = ['name']
146146
_accessors = {'dt', 'cat', 'str', 'sparse'}
147+
# tolist is not actually deprecated, just suppressed in the __dir__
147148
_deprecations = generic.NDFrame._deprecations | frozenset(
148149
['asobject', 'reshape', 'get_value', 'set_value',
149150
'from_csv', 'valid', 'tolist'])

pandas/tests/test_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,9 +1144,10 @@ def test_iterable_map(self, typ, dtype, rdtype):
11441144
'method',
11451145
[
11461146
lambda x: x.tolist(),
1147+
lambda x: x.to_list(),
11471148
lambda x: list(x),
11481149
lambda x: list(x.__iter__()),
1149-
], ids=['tolist', 'list', 'iter'])
1150+
], ids=['tolist', 'to_list', 'list', 'iter'])
11501151
def test_categorial_datetimelike(self, method):
11511152
i = CategoricalIndex([Timestamp('1999-12-31'),
11521153
Timestamp('2000-12-31')])

0 commit comments

Comments
 (0)