Skip to content

Fix pylint errors #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,12 @@ class CommonSocketType(Protocol):
def send(self, data: bytes, flags: int = ...) -> None:
"""Send data to the socket. The meaning of the optional flags kwarg is
implementation-specific."""
...

def settimeout(self, value: Optional[float]) -> None:
"""Set a timeout on blocking socket operations."""
...

def close(self) -> None:
"""Close the socket."""
...

class CommonCircuitPythonSocketType(CommonSocketType, Protocol):
"""Describes the common structure every CircuitPython socket type must have."""
Expand All @@ -84,7 +81,6 @@ def connect(
) -> None:
"""Connect to a remote socket at the provided (host, port) address. The conntype
kwarg optionally may indicate SSL or not, depending on the underlying interface."""
...

class LegacyCircuitPythonSocketType(CommonCircuitPythonSocketType, Protocol):
"""Describes the structure a legacy CircuitPython socket type must have."""
Expand All @@ -93,7 +89,6 @@ def recv(self, bufsize: int = ...) -> bytes:
"""Receive data from the socket. The return value is a bytes object representing
the data received. The maximum amount of data to be received at once is specified
by bufsize."""
...

class SupportsRecvWithFlags(Protocol):
"""Describes a type that posseses a socket recv() method supporting the flags kwarg."""
Expand All @@ -102,7 +97,6 @@ def recv(self, bufsize: int = ..., flags: int = ...) -> bytes:
"""Receive data from the socket. The return value is a bytes object representing
the data received. The maximum amount of data to be received at once is specified
by bufsize. The meaning of the optional flags kwarg is implementation-specific."""
...

class SupportsRecvInto(Protocol):
"""Describes a type that possesses a socket recv_into() method."""
Expand All @@ -114,7 +108,6 @@ def recv_into(
buffer. If nbytes is not specified (or 0), receive up to the size available in the
given buffer. The meaning of the optional flags kwarg is implementation-specific.
Returns the number of bytes received."""
...

class CircuitPythonSocketType(
CommonCircuitPythonSocketType,
Expand All @@ -124,16 +117,13 @@ class CircuitPythonSocketType(
): # pylint: disable=too-many-ancestors
"""Describes the structure every modern CircuitPython socket type must have."""

...

class StandardPythonSocketType(
CommonSocketType, SupportsRecvInto, SupportsRecvWithFlags, Protocol
):
"""Describes the structure every standard Python socket type must have."""

def connect(self, address: Union[Tuple[Any, ...], str, bytes]) -> None:
"""Connect to a remote socket at the provided address."""
...

SocketType = Union[
LegacyCircuitPythonSocketType,
Expand All @@ -149,7 +139,6 @@ class InterfaceType(Protocol):
@property
def TLS_MODE(self) -> int: # pylint: disable=invalid-name
"""Constant representing that a socket's connection mode is TLS."""
...

SSLContextType = Union[SSLContext, "_FakeSSLContext"]

Expand Down