Skip to content

Commit ce6f0a9

Browse files
topper-123jbrockmendel
authored andcommitted
TYP: PandasObject._cache (pandas-dev#32775)
1 parent 57ac04a commit ce6f0a9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/core/base.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import builtins
66
import textwrap
7-
from typing import Dict, FrozenSet, List, Optional, Union
7+
from typing import Any, Dict, FrozenSet, List, Optional, Union
88

99
import numpy as np
1010

@@ -49,6 +49,8 @@ class PandasObject(DirNamesMixin):
4949
Baseclass for various pandas objects.
5050
"""
5151

52+
_cache: Dict[str, Any]
53+
5254
@property
5355
def _constructor(self):
5456
"""
@@ -63,7 +65,7 @@ def __repr__(self) -> str:
6365
# Should be overwritten by base classes
6466
return object.__repr__(self)
6567

66-
def _reset_cache(self, key=None):
68+
def _reset_cache(self, key: Optional[str] = None) -> None:
6769
"""
6870
Reset cached properties. If ``key`` is passed, only clears that key.
6971
"""

pandas/core/indexes/base.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from datetime import datetime
22
import operator
33
from textwrap import dedent
4-
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, Hashable, Union
4+
from typing import TYPE_CHECKING, Any, FrozenSet, Hashable, Union
55
import warnings
66

77
import numpy as np
@@ -249,7 +249,6 @@ def _outer_indexer(self, left, right):
249249

250250
_typ = "index"
251251
_data: Union[ExtensionArray, np.ndarray]
252-
_cache: Dict[str, Any]
253252
_id = None
254253
_name: Label = None
255254
# MultiIndex.levels previously allowed setting the index name. We

0 commit comments

Comments
 (0)