diff --git a/stdlib/3/calendar.pyi b/stdlib/3/calendar.pyi index 957f8ce71..eb6a0af4c 100644 --- a/stdlib/3/calendar.pyi +++ b/stdlib/3/calendar.pyi @@ -1,7 +1,7 @@ import datetime from time import struct_time -from typing import Any, Iterable, List, Optional, Tuple, Sequence, Union +from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union LocaleType = Tuple[Optional[str], Optional[str]] @@ -20,7 +20,7 @@ def weekday(year: int, month: int, day: int) -> int: ... def monthrange(year: int, month: int) -> Tuple[int, int]: ... class Calendar: - def __init__(self, firstweekday: int = 0) -> None: ... + def __init__(self, firstweekday: int = ...) -> None: ... def getfirstweekday(self) -> int: ... def setfirstweekday(self, firstweekday: int) -> None: ... def iterweekdays(self) -> Iterable[int]: ... @@ -30,9 +30,9 @@ class Calendar: def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ... def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ... def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ... - def yeardatescalendar(self, year: int, width: int = 3) -> List[List[int]]: ... - def yeardays2calendar(self, year: int, width: int = 3) -> List[List[Tuple[int, int]]]: ... - def yeardayscalendar(self, year: int, width: int = 3) -> List[List[int]]: ... + def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ... + def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ... class TextCalendar(Calendar): def prweek(self, theweek: int, width: int) -> None: ... @@ -42,8 +42,8 @@ class TextCalendar(Calendar): def formatweekheader(self, width: int) -> str: ... def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... def prmonth(self, theyear: int, themonth: int, w: Any=0, l: Any = 0) -> None: ... - def formatmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ... - def formatyear(self, theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ... + def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... + def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... def pryear(self, theyear: int, w: Any = 0, l: Any = 0, c: Any = 6, m: Any = 3) -> None: ... class HTMLCalendar(Calendar): @@ -53,8 +53,8 @@ class HTMLCalendar(Calendar): def formatweekheader(self) -> str: ... 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 = 3) -> str: ... - def formatyearpage(self, theyear: int, width: int = 3, css: Optional[str] = 'calendar.css', encoding: Optional[str] = ...) -> str: ... + def formatyear(self, theyear: int, width: int = ...) -> str: ... + def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ... class different_locale: def __init__(self, locale: LocaleType) -> None: ... @@ -62,12 +62,12 @@ class different_locale: def __exit__(self, *args) -> None: ... class LocaleTextCalendar(TextCalendar): - def __init__(self, firstweekday: int = 0, locale: Optional[LocaleType] = ...) -> None: ... + def __init__(self, firstweekday: int = ..., locale: Optional[LocaleType] = ...) -> 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 = 0, locale: Optional[LocaleType] = ...) -> None: ... + def __init__(self, firstweekday: int = ..., locale: Optional[LocaleType] = ...) -> None: ... def formatweekday(self, day: int) -> str: ... def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... diff --git a/stdlib/3/importlib/__init__.pyi b/stdlib/3/importlib/__init__.pyi index 7969a3cfe..403e1ae1b 100644 --- a/stdlib/3/importlib/__init__.pyi +++ b/stdlib/3/importlib/__init__.pyi @@ -4,8 +4,8 @@ import types from typing import Any, Mapping, Optional, Sequence def __import__(name: str, globals: Mapping[str, Any] = None, - locals: Mapping[str, Any] = None, fromlist: Sequence[str] = (), - level: int = 0) -> types.ModuleType: ... + locals: Mapping[str, Any] = None, fromlist: Sequence[str] = ..., + level: int = ...) -> types.ModuleType: ... def import_module(name: str, package: str = None) -> types.ModuleType: ... diff --git a/stdlib/3/importlib/abc.pyi b/stdlib/3/importlib/abc.pyi index 6ae74d6f7..f7c746ac7 100644 --- a/stdlib/3/importlib/abc.pyi +++ b/stdlib/3/importlib/abc.pyi @@ -35,11 +35,11 @@ class InspectLoader(Loader): def exec_module(self, module: types.ModuleType) -> None: ... if sys.version_info[:2] == (3, 4): def source_to_code(self, data: Union[bytes, str], - path: str = '') -> types.CodeType: ... + path: str = ...) -> types.CodeType: ... elif sys.version_info >= (3, 5): @staticmethod def source_to_code(data: Union[bytes, str], - path: str = '') -> types.CodeType: ... + path: str = ...) -> types.CodeType: ... class ExecutionLoader(InspectLoader): @abstractmethod diff --git a/stdlib/3/multiprocessing/__init__.pyi b/stdlib/3/multiprocessing/__init__.pyi index 2aa134147..f77be99f4 100644 --- a/stdlib/3/multiprocessing/__init__.pyi +++ b/stdlib/3/multiprocessing/__init__.pyi @@ -10,8 +10,8 @@ class Lock(): def release(self) -> None: ... class AsyncResult(): - def get(self, timeout: float = -1) -> Any: ... - def wait(self, timeout: float = -1) -> None: ... + def get(self, timeout: float = ...) -> Any: ... + def wait(self, timeout: float = ...) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ... @@ -20,49 +20,49 @@ class Event(object): def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: Optional[int] = None) -> bool: ... + def wait(self, timeout: Optional[int] = ...) -> bool: ... class Pool(): - def __init__(self, processes: Optional[int] = None, - initializer: Optional[Callable[..., None]] = None, - initargs: Iterable[Any] = (), - maxtasksperchild: Optional[int] = None, + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., context: Any = None) -> None: ... def apply(self, func: Callable[..., Any], - args: Iterable[Any]=(), + args: Iterable[Any] = ..., kwds: Dict[str, Any]=...) -> Any: ... def apply_async(self, func: Callable[..., Any], - args: Iterable[Any]=(), - kwds: Dict[str, Any]=..., + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... def map(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), - chunksize: Optional[int] = None) -> List[Any]: ... + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> List[Any]: ... def map_async(self, func: Callable[..., Any], - iterable: Iterable[Any] = (), - chunksize: Optional[int] = None, + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ..., callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... def imap(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None) -> Iterable[Any]: ... def imap_unordered(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None) -> Iterable[Any]: ... def starmap(self, func: Callable[..., Any], - iterable: Iterable[Iterable[Any]]=(), + iterable: Iterable[Iterable[Any]] = ..., chunksize: Optional[int] = None) -> List[Any]: ... def starmap_async(self, func: Callable[..., Any], - iterable: Iterable[Iterable[Any]] = (), - chunksize: Optional[int] = None, + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ..., callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... def close(self) -> None: ... diff --git a/stdlib/3/multiprocessing/pool.pyi b/stdlib/3/multiprocessing/pool.pyi index ed917490d..e4174b213 100644 --- a/stdlib/3/multiprocessing/pool.pyi +++ b/stdlib/3/multiprocessing/pool.pyi @@ -5,49 +5,49 @@ from typing import Any, Callable, Iterable, Mapping, Optional, Dict, List class AsyncResult(): - def get(self, timeout: float = -1) -> Any: ... - def wait(self, timeout: float = -1) -> None: ... + def get(self, timeout: float = ...) -> Any: ... + def wait(self, timeout: float = ...) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ... class ThreadPool(): def __init__(self, processes: Optional[int] = None, initializer: Optional[Callable[..., None]] = None, - initargs: Iterable[Any] = ()) -> None: ... + initargs: Iterable[Any] = ...) -> None: ... def apply(self, func: Callable[..., Any], - args: Iterable[Any]=(), - kwds: Dict[str, Any]=...) -> Any: ... + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ...) -> Any: ... def apply_async(self, func: Callable[..., Any], - args: Iterable[Any]=(), - kwds: Dict[str, Any]=..., + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... def map(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None) -> List[Any]: ... def map_async(self, func: Callable[..., Any], - iterable: Iterable[Any] = (), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None, callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... def imap(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None) -> Iterable[Any]: ... def imap_unordered(self, func: Callable[..., Any], - iterable: Iterable[Any]=(), + iterable: Iterable[Any] = ..., chunksize: Optional[int] = None) -> Iterable[Any]: ... def starmap(self, func: Callable[..., Any], - iterable: Iterable[Iterable[Any]]=(), + iterable: Iterable[Iterable[Any]] = ..., chunksize: Optional[int] = None) -> List[Any]: ... def starmap_async(self, func: Callable[..., Any], - iterable: Iterable[Iterable[Any]] = (), + iterable: Iterable[Iterable[Any]] = ..., chunksize: Optional[int] = None, callback: Callable[..., None] = None, error_callback: Callable[[BaseException], None] = None) -> AsyncResult: ... diff --git a/tests/pytype_blacklist.txt b/tests/pytype_blacklist.txt index 720bac118..2e9712f6d 100644 --- a/tests/pytype_blacklist.txt +++ b/tests/pytype_blacklist.txt @@ -17,7 +17,6 @@ stdlib/3/os/__init__.pyi # We've not been running the pytype tests under Python 3, for quite a while. # The below are files that have regressed and need fixing: -stdlib/3/calendar.pyi stdlib/3/collections/__init__.pyi stdlib/3/collections/abc.pyi stdlib/3/concurrent/futures/__init__.pyi @@ -31,14 +30,10 @@ stdlib/3/fileinput.pyi stdlib/3/gzip.pyi stdlib/3/http/__init__.pyi stdlib/3/http/cookiejar.pyi -stdlib/3/importlib/__init__.pyi -stdlib/3/importlib/abc.pyi stdlib/3/inspect.pyi stdlib/3/json/__init__.pyi stdlib/3/json/decoder.pyi stdlib/3/json/encoder.pyi -stdlib/3/multiprocessing/__init__.pyi -stdlib/3/multiprocessing/pool.pyi stdlib/3/ssl.pyi stdlib/3/subprocess.pyi stdlib/3/sys.pyi