Skip to content

Commit 9e4faf8

Browse files
committed
cache readonly
1 parent 7e6d8ea commit 9e4faf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/dtypes/dtypes.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from pandas._libs.interval import Interval
88
from pandas._libs.tslibs import NaT, Period, Timestamp, timezones
9+
from pandas.util._decorators import cache_readonly
910

1011
from pandas.core.dtypes.generic import ABCCategoricalIndex, ABCIndexClass
1112

@@ -531,12 +532,12 @@ def __init__(self, unit="ns", tz=None):
531532
self._unit = unit
532533
self._tz = tz
533534

534-
@property
535+
@cache_readonly
535536
def unit(self):
536537
"""The precision of the datetime data."""
537538
return self._unit
538539

539-
@property
540+
@cache_readonly
540541
def tz(self):
541542
"""The timezone."""
542543
return self._tz

0 commit comments

Comments
 (0)