Skip to content

Commit 9b63a49

Browse files
authored
Re-export dateutil._common.weekday from dateutil.relativedelta (#9819)
1 parent 9c4bfd5 commit 9b63a49

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
from dateutil import relativedelta
4+
5+
6+
# An illustrative example for why we re-export dateutil._common.weekday from dateutil.relativedelta in the stub
7+
class Calendar:
8+
def __init__(self, week_start: relativedelta.weekday = relativedelta.MO) -> None:
9+
self.week_start = week_start

stubs/python-dateutil/dateutil/relativedelta.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ from datetime import date, datetime, timedelta
22
from typing import SupportsFloat, TypeVar, overload
33
from typing_extensions import Self, TypeAlias
44

5-
from ._common import weekday
5+
# See #9817 for why we reexport this here
6+
from ._common import weekday as weekday
67

78
_DateT = TypeVar("_DateT", date, datetime)
89
# Work around attribute and type having the same name.

0 commit comments

Comments
 (0)