3 ms·
That's an example for the wrong abstraction, not an example for "no DRY". Checking if a date is in the future does actually make sense, I would not do it like
by ReleaseCandidat 2y ago
That's an example for the wrong abstraction, not an example for "no DRY".
Checking if a date is in the future does actually make sense, I would not do it like that (that's more of a `raise_if_not_in_future`), but whatever:
def check_if_in_future(date):
if date <= datetime.now():
raise ValueError(
“Date must be in the future”)
def set_task_deadline(task_deadline):
check_if_in_future(task_deadline)
def set_payment_deadline(payment_deadline):
check_if_in_future(payment_deadline)