mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-26 19:47:14 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from typing import (Optional, Sequence, Union, Generic, overload,
|
||||
Iterable, Iterator, Sized, ContextManager, AnyStr)
|
||||
from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload
|
||||
|
||||
from _typeshed import ReadableBuffer
|
||||
|
||||
ACCESS_DEFAULT: int
|
||||
@@ -10,7 +10,7 @@ ACCESS_COPY: int
|
||||
|
||||
ALLOCATIONGRANULARITY: int
|
||||
|
||||
if sys.platform != 'win32':
|
||||
if sys.platform != "win32":
|
||||
MAP_ANON: int
|
||||
MAP_ANONYMOUS: int
|
||||
MAP_DENYWRITE: int
|
||||
@@ -24,15 +24,14 @@ if sys.platform != 'win32':
|
||||
PAGESIZE: int
|
||||
|
||||
class _mmap(Generic[AnyStr]):
|
||||
if sys.platform == 'win32':
|
||||
def __init__(self, fileno: int, length: int,
|
||||
tagname: Optional[str] = ..., access: int = ...,
|
||||
offset: int = ...) -> None: ...
|
||||
if sys.platform == "win32":
|
||||
def __init__(
|
||||
self, fileno: int, length: int, tagname: Optional[str] = ..., access: int = ..., offset: int = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
fileno: int, length: int, flags: int = ...,
|
||||
prot: int = ..., access: int = ...,
|
||||
offset: int = ...) -> None: ...
|
||||
def __init__(
|
||||
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def flush(self, offset: int = ..., size: int = ...) -> None: ...
|
||||
@@ -72,6 +71,7 @@ if sys.version_info >= (3,):
|
||||
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and
|
||||
# __len__, so we claim that there is also an __iter__ to help type checkers.
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
|
||||
else:
|
||||
class mmap(_mmap[bytes], Sequence[bytes]):
|
||||
def find(self, string: bytes, start: int = ..., end: int = ...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user