mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Use Literal types in calendar, add __all__ (#6827)
This commit is contained in:
@@ -2,6 +2,34 @@ import datetime
|
||||
import sys
|
||||
from time import struct_time
|
||||
from typing import Any, Iterable, Optional, Sequence
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = [
|
||||
"IllegalMonthError",
|
||||
"IllegalWeekdayError",
|
||||
"setfirstweekday",
|
||||
"firstweekday",
|
||||
"isleap",
|
||||
"leapdays",
|
||||
"weekday",
|
||||
"monthrange",
|
||||
"monthcalendar",
|
||||
"prmonth",
|
||||
"month",
|
||||
"prcal",
|
||||
"calendar",
|
||||
"timegm",
|
||||
"month_name",
|
||||
"month_abbr",
|
||||
"day_name",
|
||||
"day_abbr",
|
||||
"Calendar",
|
||||
"TextCalendar",
|
||||
"HTMLCalendar",
|
||||
"LocaleTextCalendar",
|
||||
"LocaleHTMLCalendar",
|
||||
"weekheader",
|
||||
]
|
||||
|
||||
_LocaleType = tuple[Optional[str], Optional[str]]
|
||||
|
||||
@@ -105,13 +133,12 @@ day_abbr: Sequence[str]
|
||||
month_name: Sequence[str]
|
||||
month_abbr: Sequence[str]
|
||||
|
||||
# Below constants are not in docs or __all__, but enough people have used them
|
||||
# they are now effectively public.
|
||||
MONDAY: Literal[0]
|
||||
TUESDAY: Literal[1]
|
||||
WEDNESDAY: Literal[2]
|
||||
THURSDAY: Literal[3]
|
||||
FRIDAY: Literal[4]
|
||||
SATURDAY: Literal[5]
|
||||
SUNDAY: Literal[6]
|
||||
|
||||
MONDAY: int
|
||||
TUESDAY: int
|
||||
WEDNESDAY: int
|
||||
THURSDAY: int
|
||||
FRIDAY: int
|
||||
SATURDAY: int
|
||||
SUNDAY: int
|
||||
EPOCH: Literal[1970]
|
||||
|
||||
Reference in New Issue
Block a user