|
|
|
|
|
by chacham15
743 days ago
|
|
I think it depends on how you deduplicate your code. Creating a DeadlineSettter as illustrated is definitely too much, but creating a function: def assert_datetime_in_future(datetime):
if datetime <= datetime.now():
raise ValueError(
“Date must be in the future”)
and then calling that from both places seems fairly reasonable to me. |
|