From d5d4bbbe7c15bf0c60de677711d87fba213e865e Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 6 Sep 2022 12:14:56 +0300 Subject: [PATCH] Use `ClassVar` for class-level attributes in `calendar` (#8691) Source: https://github.com/python/cpython/blob/f177f6f29b069f522a0b3ba44eaae19852b6d2b0/Lib/calendar.py#L418-L436 --- stdlib/calendar.pyi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/stdlib/calendar.pyi b/stdlib/calendar.pyi index be76ecd40..74b8d39ca 100644 --- a/stdlib/calendar.pyi +++ b/stdlib/calendar.pyi @@ -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: ...