Skip to content

Commit 2ecc490

Browse files
authored
API docs: fix type of Decimal Time properties (#798)
* API docs: fix type of Decimal Time properties * API docs: fix typo: parameter name
1 parent 4cfc89a commit 2ecc490

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

neo4j/time/__init__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def days_in_month(cls, year, month):
10451045
10461046
:param year: the year to look up
10471047
:type year: int
1048-
:param year: the month to look up
1048+
:param month: the month to look up
10491049
:type year: int
10501050
10511051
:rtype: int
@@ -1738,7 +1738,11 @@ def second(self):
17381738
This contains seconds and nanoseconds of the time.
17391739
`int(:attr:`.seconds`)` will yield the seconds without nanoseconds.
17401740
1741-
:type: float
1741+
:type: decimal.Decimal
1742+
1743+
.. versionchanged:: 4.4
1744+
The property's type changed from :class:`float` to
1745+
:class:`decimal.Decimal` to mitigate rounding issues.
17421746
"""
17431747
# TODO 5.0: return plain self.__second
17441748
with _decimal_context(prec=11):
@@ -1762,7 +1766,12 @@ def hour_minute_second(self):
17621766
Will be removed in 5.0.
17631767
Use :attr:`.hour_minute_second_nanosecond` instead.
17641768
1765-
:type: (int, int, float)"""
1769+
:type: (int, int, decimal.Decimal)
1770+
1771+
.. versionchanged:: 4.4
1772+
Last element of the property changed from :class:`float` to
1773+
:class:`decimal.Decimal` to mitigate rounding issues.
1774+
"""
17661775
return self.__hour, self.__minute, self.second
17671776

17681777
@property

0 commit comments

Comments
 (0)