Skip to content

Commit cf8c030

Browse files
committed
fix utils:date_range type annotations
1 parent bb869a4 commit cf8c030

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dayplot/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import Union, Literal
55
import calendar
66
from datetime import date, datetime, timedelta
7+
from typing import Generator
78

89

910
PACKAGE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -71,12 +72,12 @@ def relative_date_add(
7172

7273
def date_range(
7374
start: date,
74-
stop: date | None = None,
75+
stop: Union[date, None] = None,
7576
*,
7677
years: int = 0,
7778
months: int = 0,
7879
days: int = 0,
79-
) -> date:
80+
) -> Generator[date, None, None]:
8081
cur = start
8182
while stop is None or cur <= stop:
8283
yield cur

0 commit comments

Comments
 (0)