@@ -968,7 +968,7 @@ def days_in_month(cls, year: int, month: int) -> int:
968
968
"""Return the number of days in `month` of `year`.
969
969
970
970
:param year: the year to look up
971
- :param year : the month to look up
971
+ :param month : the month to look up
972
972
973
973
:raises ValueError: if `year` or `month` is out of range:
974
974
:attr:`MIN_YEAR` <= year <= :attr:`MAX_YEAR`;
@@ -1380,6 +1380,9 @@ class Time(time_base_class, metaclass=TimeType):
1380
1380
:param tzinfo: timezone or None to get a local :class:`.Time`.
1381
1381
1382
1382
:raises ValueError: if one of the parameters is out of range.
1383
+
1384
+ ..versionchanged:: 5.0
1385
+ The parameter ``second`` no longer accepts :class:`float` values.
1383
1386
"""
1384
1387
1385
1388
# CONSTRUCTOR #
@@ -1497,6 +1500,11 @@ def from_ticks(cls, ticks: int, tz: _tzinfo = None) -> Time:
1497
1500
1498
1501
:raises ValueError: if ticks is out of bounds
1499
1502
(0 <= ticks < 86400000000000)
1503
+
1504
+ ..versionchanged:: 5.0
1505
+ The parameter ``ticks`` no longer accepts :class:`float` values
1506
+ but only :class:`int`. It's now nanoseconds since midnight instead
1507
+ of seconds.
1500
1508
"""
1501
1509
if not isinstance (ticks , int ):
1502
1510
raise TypeError ("Ticks must be int" )
@@ -1606,7 +1614,12 @@ def utc_now(cls) -> Time:
1606
1614
1607
1615
@property
1608
1616
def ticks (self ) -> int :
1609
- """The total number of nanoseconds since midnight."""
1617
+ """The total number of nanoseconds since midnight.
1618
+
1619
+ .. versionchanged:: 5.0
1620
+ The property's type changed from :class:`float` to :class:`int`.
1621
+ It's now nanoseconds since midnight instead of seconds.
1622
+ """
1610
1623
return self .__ticks
1611
1624
1612
1625
@property
@@ -1621,7 +1634,17 @@ def minute(self) -> int:
1621
1634
1622
1635
@property
1623
1636
def second (self ) -> int :
1624
- """The seconds of the time."""
1637
+ """The seconds of the time.
1638
+
1639
+ .. versionchanged:: 4.4
1640
+ The property's type changed from :class:`float` to
1641
+ :class:`decimal.Decimal` to mitigate rounding issues.
1642
+
1643
+ .. versionchanged:: 5.0
1644
+ The property's type changed from :class:`decimal.Decimal` to
1645
+ :class:`int`. It does not longer cary sub-second information.
1646
+ Use `attr:`nanosecond` instead.
1647
+ """
1625
1648
return self .__second
1626
1649
1627
1650
@property
0 commit comments