Use ClassVar for class-level attributes in calendar (#8691)

Source: f177f6f29b/Lib/calendar.py (L418-L436)
This commit is contained in:
Nikita Sobolev
2022-09-06 12:14:56 +03:00
committed by GitHub
parent 51e8325c10
commit d5d4bbbe7c

View File

@@ -2,6 +2,7 @@ import datetime
import sys
from collections.abc import Iterable, Sequence
from time import struct_time
from typing import ClassVar
from typing_extensions import Literal, TypeAlias
__all__ = [
@@ -88,6 +89,13 @@ def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ..
def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
class HTMLCalendar(Calendar):
cssclasses: ClassVar[list[str]]
cssclass_noday: ClassVar[str]
cssclasses_weekday_head: ClassVar[list[str]]
cssclass_month_head: ClassVar[str]
cssclass_month: ClassVar[str]
cssclass_year: ClassVar[str]
cssclass_year_head: ClassVar[str]
def formatday(self, day: int, weekday: int) -> str: ...
def formatweek(self, theweek: int) -> str: ...
def formatweekday(self, day: int) -> str: ...
@@ -96,13 +104,6 @@ class HTMLCalendar(Calendar):
def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
def formatyear(self, theyear: int, width: int = ...) -> str: ...
def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
cssclasses: list[str]
cssclass_noday: str
cssclasses_weekday_head: list[str]
cssclass_month_head: str
cssclass_month: str
cssclass_year: str
cssclass_year_head: str
class different_locale:
def __init__(self, locale: _LocaleType) -> None: ...