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,5 +1,5 @@
import sys
from typing import NoReturn, Optional, Sequence, Union
from typing import NoReturn, Sequence
ACCESS_DEFAULT: int
ACCESS_READ: int
@@ -25,9 +25,7 @@ if sys.platform != "win32":
class mmap(Sequence[bytes]):
if sys.platform == "win32":
def __init__(
self, fileno: int, length: int, tagname: Optional[str] = ..., access: int = ..., offset: int = ...
) -> None: ...
def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ...
else:
def __init__(
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
@@ -47,7 +45,7 @@ class mmap(Sequence[bytes]):
def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ...
def read(self, num: int) -> bytes: ...
def write(self, string: bytes) -> None: ...
def __getitem__(self, index: Union[int, slice]) -> bytes: ...
def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ...
def __delitem__(self, index: Union[int, slice]) -> NoReturn: ...
def __setitem__(self, index: Union[int, slice], object: bytes) -> None: ...
def __getitem__(self, index: int | slice) -> bytes: ...
def __getslice__(self, i: int | None, j: int | None) -> bytes: ...
def __delitem__(self, index: int | slice) -> NoReturn: ...
def __setitem__(self, index: int | slice, object: bytes) -> None: ...