No need for DateOrDateTime type alias
This commit is contained in:
parent
e7ae7123f6
commit
e38e357f63
|
@ -2,10 +2,8 @@
|
|||
|
||||
from datetime import date, datetime, timezone
|
||||
|
||||
DateOrDateTime = datetime | date
|
||||
|
||||
|
||||
def as_date(d: DateOrDateTime) -> date:
|
||||
def as_date(d: datetime | date) -> date:
|
||||
"""Convert datetime to date."""
|
||||
match d:
|
||||
case datetime():
|
||||
|
@ -16,7 +14,7 @@ def as_date(d: DateOrDateTime) -> date:
|
|||
raise TypeError(f"Unsupported type: {type(d)}")
|
||||
|
||||
|
||||
def as_datetime(d: DateOrDateTime) -> datetime:
|
||||
def as_datetime(d: datetime | date) -> datetime:
|
||||
"""Date/time of event."""
|
||||
match d:
|
||||
case datetime():
|
||||
|
|
Loading…
Reference in a new issue