Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,6 +1,6 @@
import datetime
from time import struct_time
from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union
from typing import Any, Iterable, List, Optional, Sequence, Tuple
_LocaleType = Tuple[Optional[str], Optional[str]]
@@ -63,7 +63,7 @@ class HTMLCalendar(Calendar):
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
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: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ...
def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
class TimeEncoding:
def __init__(self, locale: _LocaleType) -> None: ...
@@ -71,12 +71,12 @@ class TimeEncoding:
def __exit__(self, *args: Any) -> None: ...
class LocaleTextCalendar(TextCalendar):
def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ...
def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
def formatweekday(self, day: int, width: int) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ...
class LocaleHTMLCalendar(HTMLCalendar):
def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ...
def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ...
def formatweekday(self, day: int) -> str: ...
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
@@ -85,7 +85,7 @@ c: TextCalendar
def setfirstweekday(firstweekday: int) -> None: ...
def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
def timegm(tuple: Union[Tuple[int, ...], struct_time]) -> int: ...
def timegm(tuple: Tuple[int, ...] | struct_time) -> int: ...
# Data attributes
day_name: Sequence[str]