mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-20 10:02:51 +08:00
Fixing flake8 E265 errors
This commit is contained in:
@@ -5,6 +5,6 @@
|
||||
# import message
|
||||
|
||||
# TODO
|
||||
#class MIMEBase(message.Message):
|
||||
# class MIMEBase(message.Message):
|
||||
class MIMEBase:
|
||||
def __init__(self, _maintype, _subtype, **_params) -> None: ...
|
||||
|
||||
@@ -272,8 +272,8 @@ O_LARGEFILE = 0 # Gnu extension if in C library
|
||||
P_NOWAIT = 0
|
||||
P_NOWAITO = 0
|
||||
P_WAIT = 0
|
||||
#P_DETACH = 0 # Windows only
|
||||
#P_OVERLAY = 0 # Windows only
|
||||
# P_DETACH = 0 # Windows only
|
||||
# P_OVERLAY = 0 # Windows only
|
||||
|
||||
# wait()/waitpid() options
|
||||
WNOHANG = 0 # Unix only
|
||||
|
||||
@@ -52,7 +52,7 @@ def relpath(path: AnyStr, start: AnyStr = ...) -> AnyStr: ...
|
||||
def samefile(path1: unicode, path2: unicode) -> bool: ...
|
||||
def sameopenfile(fp1: int, fp2: int) -> bool: ...
|
||||
# TODO
|
||||
#def samestat(stat1: stat_result,
|
||||
# def samestat(stat1: stat_result,
|
||||
# stat2: stat_result) -> bool: ... # Unix only
|
||||
|
||||
def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
|
||||
|
||||
@@ -4,14 +4,14 @@ from typing import Any, Sequence, TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
# TODO uncomment when mypy#2035 is fixed
|
||||
#def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
#def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
#def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# TODO uncomment when mypy# 2035 is fixed
|
||||
# def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
#
|
||||
#def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
#def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
#def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
# def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
|
||||
def bisect_left(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence, x: Any, lo: int = ..., hi: int = ...) -> int: ...
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from typing import Any, Callable, Dict, Optional, IO, Union
|
||||
import sys
|
||||
if sys.version_info >= (3,):
|
||||
#from configparser import RawConfigParser
|
||||
# from configparser import RawConfigParser
|
||||
# TODO add RawConfigParser to configparser stubs
|
||||
RawConfigParser = Any
|
||||
else:
|
||||
|
||||
@@ -30,7 +30,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def run_forever(self) -> None: ...
|
||||
|
||||
# Can't use a union, see mypy issue #1873.
|
||||
# Can't use a union, see mypy issue # 1873.
|
||||
@overload
|
||||
@abstractmethod
|
||||
def run_until_complete(self, future: Generator[Any, Any, _T]) -> _T: ...
|
||||
@@ -94,28 +94,28 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
def create_datagram_endpoint(self, protocol_factory: Any,
|
||||
local_addr: str = ..., remote_addr: str = ..., *,
|
||||
family: int = ..., proto: int = ..., flags: int = ...) -> tuple: ...
|
||||
#?? check Any
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
# Pipes and subprocesses.
|
||||
@abstractmethod
|
||||
def connect_read_pipe(self, protocol_factory: Any, pipe: Any) -> tuple: ...
|
||||
#?? check Any
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def connect_write_pipe(self, protocol_factory: Any, pipe: Any) -> tuple: ...
|
||||
#?? check Any
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def subprocess_shell(self, protocol_factory: Any, cmd: Union[bytes, str], *, stdin: Any = ...,
|
||||
stdout: Any = ..., stderr: Any = ...,
|
||||
**kwargs: Any) -> tuple: ...
|
||||
#?? check Any
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def subprocess_exec(self, protocol_factory: Any, *args: List[Any], stdin: Any = ...,
|
||||
stdout: Any = ..., stderr: Any = ...,
|
||||
**kwargs: Any) -> tuple: ...
|
||||
#?? check Any
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def add_reader(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
|
||||
@@ -127,11 +127,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
def remove_writer(self, fd: int) -> None: ...
|
||||
# Completion based I/O methods returning Futures.
|
||||
@abstractmethod
|
||||
def sock_recv(self, sock: Any, nbytes: int) -> Any: ... #TODO
|
||||
def sock_recv(self, sock: Any, nbytes: int) -> Any: ... # TODO
|
||||
@abstractmethod
|
||||
def sock_sendall(self, sock: Any, data: bytes) -> None: ... #TODO
|
||||
def sock_sendall(self, sock: Any, data: bytes) -> None: ... # TODO
|
||||
@abstractmethod
|
||||
def sock_connect(self, sock: Any, address: str) -> Any: ... #TODO
|
||||
def sock_connect(self, sock: Any, address: str) -> Any: ... # TODO
|
||||
@abstractmethod
|
||||
def sock_accept(self, sock: Any) -> Any: ...
|
||||
# Signal handling.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from _curses import *
|
||||
# Stubgen imports a python version of has_key only if it's not present
|
||||
#in _curses (which it is in this stub)
|
||||
# in _curses (which it is in this stub)
|
||||
# from .has_key import has_key as has_key
|
||||
|
||||
def initscr(): ...
|
||||
|
||||
@@ -15,9 +15,9 @@ class Finder(metaclass=ABCMeta): ...
|
||||
# Technically this class defines the following method, but its subclasses
|
||||
# in this module violate its signature. Since this class is deprecated, it's
|
||||
# easier to simply ignore that this method exists.
|
||||
#@abstractmethod
|
||||
#def find_module(self, fullname: str,
|
||||
# path: Sequence[_Path] = None) -> Optional[Loader]: ...
|
||||
# @abstractmethod
|
||||
# def find_module(self, fullname: str,
|
||||
# path: Sequence[_Path] = None) -> Optional[Loader]: ...
|
||||
|
||||
class ResourceLoader(Loader):
|
||||
@abstractmethod
|
||||
|
||||
@@ -18,13 +18,13 @@ open = builtins.open
|
||||
|
||||
# FIXME when mypy handle condtional, we can uncomment the next block and remove
|
||||
# the temporary fix
|
||||
#if sys.version_info >= (3, 3):
|
||||
# BlockingIOError = BlockingIOError
|
||||
# class UnsupportedOperation(OSError, ValueError): ...
|
||||
#else:
|
||||
# class BlockingIOError(IOError):
|
||||
# characters_written = ... # type: int
|
||||
# class UnsupportedOperation(IOError, ValueError): ...
|
||||
# if sys.version_info >= (3, 3):
|
||||
# BlockingIOError = BlockingIOError
|
||||
# class UnsupportedOperation(OSError, ValueError): ...
|
||||
# else:
|
||||
# class BlockingIOError(IOError):
|
||||
# characters_written = ... # type: int
|
||||
# class UnsupportedOperation(IOError, ValueError): ...
|
||||
class BlockingIOError(OSError):
|
||||
characters_written = ... # type: int
|
||||
class UnsupportedOperation(OSError, ValueError): ...
|
||||
@@ -190,12 +190,12 @@ class TextIOBase(IOBase):
|
||||
class TextIOWrapper(TextIO):
|
||||
line_buffering = ... # type: bool
|
||||
# TODO uncomment after fixing mypy about using write_through
|
||||
#if sys.version_info >= (3, 3):
|
||||
# if sys.version_info >= (3, 3):
|
||||
# def __init__(self, buffer: IO[bytes], encoding: str = ...,
|
||||
# errors: Optional[str] = ..., newline: Optional[str] = ...,
|
||||
# line_buffering: bool = ..., write_through: bool = ...) \
|
||||
# -> None: ...
|
||||
#else:
|
||||
# else:
|
||||
# def __init__(self, buffer: IO[bytes],
|
||||
# encoding: str = ..., errors: Optional[str] = ...,
|
||||
# newline: Optional[str] = ..., line_buffering: bool = ...) \
|
||||
|
||||
@@ -94,13 +94,13 @@ EX_NOTFOUND = 0 # Unix only
|
||||
P_NOWAIT = 0
|
||||
P_NOWAITO = 0
|
||||
P_WAIT = 0
|
||||
#P_DETACH = 0 # Windows only
|
||||
#P_OVERLAY = 0 # Windows only
|
||||
# P_DETACH = 0 # Windows only
|
||||
# P_OVERLAY = 0 # Windows only
|
||||
|
||||
# wait()/waitpid() options
|
||||
WNOHANG = 0 # Unix only
|
||||
#WCONTINUED = 0 # some Unix systems
|
||||
#WUNTRACED = 0 # Unix only
|
||||
# WCONTINUED = 0 # some Unix systems
|
||||
# WUNTRACED = 0 # Unix only
|
||||
|
||||
TMP_MAX = 0 # Undocumented, but used by tempfile
|
||||
|
||||
|
||||
@@ -55,11 +55,11 @@ def relpath(path: AnyStr, start: AnyStr = ...) -> AnyStr: ...
|
||||
|
||||
def samefile(path1: AnyStr, path2: AnyStr) -> bool: ...
|
||||
def sameopenfile(fp1: int, fp2: int) -> bool: ...
|
||||
#def samestat(stat1: stat_result,
|
||||
# def samestat(stat1: stat_result,
|
||||
# stat2: stat_result) -> bool: ... # Unix only
|
||||
|
||||
def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
|
||||
def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
|
||||
def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
|
||||
|
||||
#def splitunc(path: str) -> Tuple[str, str]: ... # Windows only, deprecated
|
||||
# def splitunc(path: str) -> Tuple[str, str]: ... # Windows only, deprecated
|
||||
|
||||
@@ -38,9 +38,9 @@ def samefile(path1: str, path2: str) -> bool: ...
|
||||
|
||||
def sameopenfile(fp1: IO[Any], fp2: IO[Any]) -> bool: ...
|
||||
|
||||
#def samestat(stat1: stat_result, stat2: stat_result) -> bool:
|
||||
# def samestat(stat1: stat_result, stat2: stat_result) -> bool:
|
||||
# ... # Unix only
|
||||
def split(path: str) -> Tuple[str, str]: ...
|
||||
def splitdrive(path: str) -> Tuple[str, str]: ...
|
||||
def splitext(path: str) -> Tuple[str, str]: ...
|
||||
#def splitunc(path: str) -> Tuple[str, str] : ... # Windows only, deprecated
|
||||
# def splitunc(path: str) -> Tuple[str, str] : ... # Windows only, deprecated
|
||||
|
||||
@@ -17,7 +17,7 @@ argv = ... # type: List[str]
|
||||
byteorder = ... # type: str
|
||||
builtin_module_names = ... # type: Sequence[str] # actually a tuple of strings
|
||||
copyright = ... # type: str
|
||||
#dllhandle = 0 # Windows only
|
||||
# dllhandle = 0 # Windows only
|
||||
dont_write_bytecode = False
|
||||
__displayhook__ = ... # type: Any # contains the original value of displayhook
|
||||
__excepthook__ = ... # type: Any # contains the original value of excepthook
|
||||
@@ -53,7 +53,7 @@ api_version = 0
|
||||
warnoptions = ... # type: Any
|
||||
# Each entry is a tuple of the form (action, message, category, module,
|
||||
# lineno)
|
||||
#winver = '' # Windows only
|
||||
# winver = '' # Windows only
|
||||
_xoptions = ... # type: Dict[Any, Any]
|
||||
|
||||
flags = ... # type: _flags
|
||||
|
||||
Reference in New Issue
Block a user