3434 from typing_extensions import Literal , TypeAlias
3535
3636 _Instant : TypeAlias = date | time | float | None
37- _PredefinedTimeFormat : TypeAlias = Literal [" full" , " long" , " medium" , " short" ]
38- _Context : TypeAlias = Literal [" format" , " stand-alone" ]
37+ _PredefinedTimeFormat : TypeAlias = Literal [' full' , ' long' , ' medium' , ' short' ]
38+ _Context : TypeAlias = Literal [' format' , ' stand-alone' ]
3939 _DtOrTzinfo : TypeAlias = datetime | tzinfo | str | int | time | None
4040
4141# "If a given short metazone form is known NOT to be understood in a given
@@ -327,7 +327,7 @@ def __repr__(self) -> str:
327327 return f"<TimezoneTransition { self .from_tz } -> { self .to_tz } ({ self .activates } )>"
328328
329329
330- def get_period_names (width : Literal [" abbreviated" , " narrow" , " wide" ] = 'wide' ,
330+ def get_period_names (width : Literal [' abbreviated' , ' narrow' , ' wide' ] = 'wide' ,
331331 context : _Context = 'stand-alone' , locale : Locale | str | None = LC_TIME ) -> LocaleDataDict :
332332 """Return the names for day periods (AM/PM) used by the locale.
333333
@@ -341,7 +341,7 @@ def get_period_names(width: Literal["abbreviated", "narrow", "wide"] = 'wide',
341341 return Locale .parse (locale ).day_periods [context ][width ]
342342
343343
344- def get_day_names (width : Literal [" abbreviated" , " narrow" , " short" , " wide" ] = 'wide' ,
344+ def get_day_names (width : Literal [' abbreviated' , ' narrow' , ' short' , ' wide' ] = 'wide' ,
345345 context : _Context = 'format' , locale : Locale | str | None = LC_TIME ) -> LocaleDataDict :
346346 """Return the day names used by the locale for the specified format.
347347
@@ -361,7 +361,7 @@ def get_day_names(width: Literal["abbreviated", "narrow", "short", "wide"] = 'wi
361361 return Locale .parse (locale ).days [context ][width ]
362362
363363
364- def get_month_names (width : Literal [" abbreviated" , " narrow" , " wide" ] = 'wide' ,
364+ def get_month_names (width : Literal [' abbreviated' , ' narrow' , ' wide' ] = 'wide' ,
365365 context : _Context = 'format' , locale : Locale | str | None = LC_TIME ) -> LocaleDataDict :
366366 """Return the month names used by the locale for the specified format.
367367
@@ -379,7 +379,7 @@ def get_month_names(width: Literal["abbreviated", "narrow", "wide"] = 'wide',
379379 return Locale .parse (locale ).months [context ][width ]
380380
381381
382- def get_quarter_names (width : Literal [" abbreviated" , " narrow" , " wide" ] = 'wide' ,
382+ def get_quarter_names (width : Literal [' abbreviated' , ' narrow' , ' wide' ] = 'wide' ,
383383 context : _Context = 'format' , locale : Locale | str | None = LC_TIME ) -> LocaleDataDict :
384384 """Return the quarter names used by the locale for the specified format.
385385
@@ -397,7 +397,7 @@ def get_quarter_names(width: Literal["abbreviated", "narrow", "wide"] = 'wide',
397397 return Locale .parse (locale ).quarters [context ][width ]
398398
399399
400- def get_era_names (width : Literal [" abbreviated" , " narrow" , " wide" ] = 'wide' ,
400+ def get_era_names (width : Literal [' abbreviated' , ' narrow' , ' wide' ] = 'wide' ,
401401 locale : Locale | str | None = LC_TIME ) -> LocaleDataDict :
402402 """Return the era names used by the locale for the specified format.
403403
@@ -461,7 +461,7 @@ def get_time_format(format: _PredefinedTimeFormat = 'medium', locale: Locale | s
461461 return Locale .parse (locale ).time_formats [format ]
462462
463463
464- def get_timezone_gmt (datetime : _Instant = None , width : Literal [" long" , " short" , " iso8601" , " iso8601_short" ] = 'long' ,
464+ def get_timezone_gmt (datetime : _Instant = None , width : Literal [' long' , ' short' , ' iso8601' , ' iso8601_short' ] = 'long' ,
465465 locale : Locale | str | None = LC_TIME , return_z : bool = False ) -> str :
466466 """Return the timezone associated with the given `datetime` object formatted
467467 as string indicating the offset from GMT.
@@ -593,8 +593,8 @@ def get_timezone_location(dt_or_tzinfo: _DtOrTzinfo = None, locale: Locale | str
593593 })
594594
595595
596- def get_timezone_name (dt_or_tzinfo : _DtOrTzinfo = None , width : Literal [" long" , " short" ] = 'long' , uncommon : bool = False ,
597- locale : Locale | str | None = LC_TIME , zone_variant : Literal [" generic" , " daylight" , " standard" ] | None = None ,
596+ def get_timezone_name (dt_or_tzinfo : _DtOrTzinfo = None , width : Literal [' long' , ' short' ] = 'long' , uncommon : bool = False ,
597+ locale : Locale | str | None = LC_TIME , zone_variant : Literal [' generic' , ' daylight' , ' standard' ] | None = None ,
598598 return_zone : bool = False ) -> str :
599599 r"""Return the localized display name for the given timezone. The timezone
600600 may be specified using a ``datetime`` or `tzinfo` object.
@@ -900,8 +900,8 @@ def format_skeleton(skeleton: str, datetime: _Instant = None, tzinfo: tzinfo | N
900900
901901
902902def format_timedelta (delta : timedelta | int ,
903- granularity : Literal [" year" , " month" , " week" , " day" , " hour" , " minute" , " second" ] = 'second' ,
904- threshold : float = .85 , add_direction : bool = False , format : Literal [" narrow" , " short" , " medium" , " long" ] = 'long' ,
903+ granularity : Literal [' year' , ' month' , ' week' , ' day' , ' hour' , ' minute' , ' second' ] = 'second' ,
904+ threshold : float = .85 , add_direction : bool = False , format : Literal [' narrow' , ' short' , ' medium' , ' long' ] = 'long' ,
905905 locale : Locale | str | None = LC_TIME ) -> str :
906906 """Return a time delta according to the rules of the given locale.
907907
@@ -1124,7 +1124,7 @@ def format_interval(start: _Instant, end: _Instant, skeleton: str | None = None,
11241124 return _format_fallback_interval (start , end , skeleton , tzinfo , locale )
11251125
11261126
1127- def get_period_id (time : _Instant , tzinfo : _pytz .BaseTzInfo | None = None , type : Literal [" selection" ] | None = None ,
1127+ def get_period_id (time : _Instant , tzinfo : _pytz .BaseTzInfo | None = None , type : Literal [' selection' ] | None = None ,
11281128 locale : Locale | str | None = LC_TIME ) -> str :
11291129 """
11301130 Get the day period ID for a given time.
0 commit comments