mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user