Skip to content

Commit 98241d2

Browse files
committed
Instructive comment for _apply_binary_operation
1 parent e99a66b commit 98241d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cf/timeduration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,10 +737,13 @@ def _apply_binary_arithmetic(
737737
738738
"""
739739
if isinstance(other, (int, float, self.__class__)):
740+
# 'other' is a number or another TimeDuration object => we
741+
# can use the usual binary operation method.
740742
return self._binary_operation(other, op, aug_assignment)
741743

742744
if may_be_datetime and hasattr(other, "timetuple"):
743-
# other is a date-time object
745+
# 'other' is a date-time object => we must use the special
746+
# datetime arithmetic operation.
744747
try:
745748
return self._datetime_arithmetic(other, getattr(operator, op))
746749
except TypeError:

0 commit comments

Comments
 (0)