Skip to content

Commit 2140fc1

Browse files
committed
added inline docstring to enforce that min,max,reso are constants not methods
1 parent 8a60f00 commit 2140fc1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,14 +1939,32 @@ class Timedelta(_Timedelta):
19391939
Timedelta('1 days 00:00:00')
19401940
19411941
We see that either way we get the same result
1942+
1943+
Accessing the smallest and largest Timedelta values:
1944+
1945+
>>> pd.Timedelta.min
1946+
Timedelta('-106751 days +00:12:44.000000')
1947+
1948+
>>> pd.Timedelta.max
1949+
Timedelta('106751 days 23:47:16.854775807')
1950+
1951+
Checking the resolution of a Timedelta object:
1952+
1953+
>>> pd.Timedelta.resolution
1954+
Timedelta('0 days 00:00:00.000000001')
19421955
"""
19431956

19441957
_req_any_kwargs_new = {"weeks", "days", "hours", "minutes", "seconds",
19451958
"milliseconds", "microseconds", "nanoseconds"}
19461959

19471960
min = MinMaxReso("min")
1961+
"""Timedelta: The minimum representable value."""
1962+
19481963
max = MinMaxReso("max")
1964+
"""Timedelta: The maximum representable value."""
1965+
19491966
resolution = MinMaxReso("resolution")
1967+
"""Timedelta: The smallest representable increment."""
19501968

19511969
def __new__(cls, object value=_no_input, unit=None, **kwargs):
19521970
if value is _no_input:

0 commit comments

Comments
 (0)