From de98690e7274e3005e3509ddf2d21cd8fadc9906 Mon Sep 17 00:00:00 2001 From: Vincent Barbaresi Date: Mon, 26 Oct 2020 03:58:09 +0100 Subject: [PATCH] update math and gzip stubs for Python 3.8 (#4710) I ran stubtest and spotted 2 things missing in 3.8 stdlib - added BadGzipFile exception for gzip: https://docs.python.org/3/library/gzip.html#gzip.BadGzipFile - added math.perm() method: https://docs.python.org/3/library/math.html#math.perm --- stdlib/2and3/math.pyi | 5 ++++- stdlib/3/gzip.pyi | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/math.pyi b/stdlib/2and3/math.pyi index 562ea6131..6f9a89996 100644 --- a/stdlib/2and3/math.pyi +++ b/stdlib/2and3/math.pyi @@ -1,5 +1,5 @@ import sys -from typing import Iterable, SupportsFloat, SupportsInt, Tuple, overload +from typing import Iterable, Optional, SupportsFloat, SupportsInt, Tuple, overload e: float pi: float @@ -94,6 +94,9 @@ def modf(__x: SupportsFloat) -> Tuple[float, float]: ... if sys.version_info >= (3, 9): def nextafter(__x: SupportsFloat, __y: SupportsFloat) -> float: ... +if sys.version_info >= (3, 8): + def perm(__n: int, __k: Optional[int] = ...) -> int: ... + def pow(__x: SupportsFloat, __y: SupportsFloat) -> float: ... if sys.version_info >= (3, 8): diff --git a/stdlib/3/gzip.pyi b/stdlib/3/gzip.pyi index 6d9fef73e..4ce54b3b8 100644 --- a/stdlib/3/gzip.pyi +++ b/stdlib/3/gzip.pyi @@ -43,6 +43,9 @@ class _PaddedFile: def seek(self, off: int) -> int: ... def seekable(self) -> bool: ... +if sys.version_info >= (3, 8): + class BadGzipFile(OSError): ... + class GzipFile(_compression.BaseStream): myfileobj: Optional[IO[bytes]] mode: str