Skip to content

Commit 55072a0

Browse files
committed
Renamed
1 parent ad6a202 commit 55072a0

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ Performance Improvements
958958
- Improved performance of :func:`pandas.core.groupby.GroupBy.any` and :func:`pandas.core.groupby.GroupBy.all` (:issue:`15435`)
959959
- Improved performance of :func:`pandas.core.groupby.GroupBy.pct_change` (:issue:`19165`)
960960
- Improved performance of :func:`Series.isin` in the case of categorical dtypes (:issue:`20003`)
961-
- Improved performance of ``Series.__getattribute__`` when the Series has certain index types. This manifiested in slow printing of large Series with a ``DatetimeIndex`` (:issue:`19764`)
961+
- Improved performance of ``getattr(Series, attr)`` when the Series has certain index types. This manifiested in slow printing of large Series with a ``DatetimeIndex`` (:issue:`19764`)
962962
- Fixed a performance regression for :func:`GroupBy.nth` and :func:`GroupBy.last` with some object columns (:issue:`19283`)
963963

964964
.. _whatsnew_0230.docs:

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4375,7 +4375,7 @@ def __getattr__(self, name):
43754375
name in self._accessors):
43764376
return object.__getattribute__(self, name)
43774377
else:
4378-
if self._info_axis._is_dotable and name in self._info_axis:
4378+
if self._info_axis.__can_hold_identifiers and name in self._info_axis:
43794379
return self[name]
43804380
return object.__getattribute__(self, name)
43814381

pandas/core/indexes/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ class Index(IndexOpsMixin, PandasObject):
246246
_accessors = set(['str'])
247247
# Whether items can be selected from NDFrame.<item>
248248
# Some indexes (DatetimeIndex, Int64Index) cannot contain
249-
# valid Python identifiers. Setting _is_dotable = False is an
249+
# valid Python identifiers. Setting __can_hold_identifiers = False is an
250250
# optimization.
251251
# https://github.com/pandas-dev/pandas/issues/19764
252-
_is_dotable = True
252+
__can_hold_identifiers = True
253253

254254
str = CachedAccessor("str", StringMethods)
255255

pandas/core/indexes/interval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class IntervalIndex(IntervalMixin, Index):
207207
_typ = 'intervalindex'
208208
_comparables = ['name']
209209
_attributes = ['name', 'closed']
210-
_is_dotable = False # can't contain Python identifiers
210+
__can_hold_identifiers = False # can't contain Python identifiers
211211

212212
# we would like our indexing holder to defer to us
213213
_defer_to_indexing = True

pandas/core/indexes/numeric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NumericIndex(Index):
3131
3232
"""
3333
_is_numeric_dtype = True
34-
_is_dotable = False # Can't contain Python identifiers
34+
__can_hold_identifiers = False # Can't contain Python identifiers
3535

3636
def __new__(cls, data=None, dtype=None, copy=False, name=None,
3737
fastpath=False):

pandas/core/indexes/period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class PeriodIndex(DatelikeOps, DatetimeIndexOpsMixin, Int64Index):
204204
"""
205205
_typ = 'periodindex'
206206
_attributes = ['name', 'freq']
207-
_is_dotable = False # Can't contain Python identifiers
207+
__can_hold_identifiers = False # Can't contain Python identifiers
208208

209209
# define my properties & methods for delegation
210210
_other_ops = []

pandas/tests/indexes/datetimelike.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
class DatetimeLike(Base):
1010

11-
def test_is_dotable(self):
11+
def test__can_hold_identifiers(self):
1212
idx = self.create_index()
13-
assert idx._is_dotable is False
13+
assert idx.__can_hold_identifiers is False
1414

1515
def test_shift_identity(self):
1616

pandas/tests/indexes/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def generate_index_types(self, skip_index_keys=[]):
6666
if key not in skip_index_keys:
6767
yield key, idx
6868

69-
def test_is_dotable(self):
69+
def test__can_hold_identifiers(self):
7070
idx = self.create_index()
71-
assert idx._is_dotable is True
71+
assert idx.__can_hold_identifiers is True
7272

7373
def test_new_axis(self):
7474
new_index = self.dateIndex[None, :]

pandas/tests/indexes/test_category.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def create_index(self, categories=None, ordered=False):
3333
return CategoricalIndex(
3434
list('aabbca'), categories=categories, ordered=ordered)
3535

36-
def test_is_dotable(self):
36+
def test__can_hold_identifiers(self):
3737
ci = self.create_index(categories=list('abcd'))
38-
assert ci._is_dotable is True
38+
assert ci.__can_hold_identifiers is True
3939

4040
def test_construction(self):
4141

pandas/tests/indexes/test_multi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def setup_method(self, method):
4848
def create_index(self):
4949
return self.index
5050

51-
def test_is_dotable(self):
51+
def test__can_hold_identifiers(self):
5252
idx = self.create_index()
53-
assert idx._is_dotable is True
53+
assert idx.__can_hold_identifiers is True
5454

5555
def test_boolean_context_compat2(self):
5656

0 commit comments

Comments
 (0)