Skip to content

Commit f315b1d

Browse files
committed
Fix pylint errors
1 parent d7370d8 commit f315b1d

File tree

7 files changed

+2
-25
lines changed

7 files changed

+2
-25
lines changed

circuitpython_typing/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ def read(self, count: Optional[int] = None) -> Optional[bytes]:
6666
or if the parameter is not specified in the call,
6767
the outcome is implementation-dependent.
6868
"""
69-
...
7069

7170
# Should be `, /)`, but not available in Python 3.7.
7271
def write(self, buf: ReadableBuffer) -> Optional[int]:
7372
"""Write the bytes in ``buf`` to the stream."""
74-
...
7573

7674

7775
# These types may not be in adafruit-blinka, so use the string form instead of a resolved name.

circuitpython_typing/http.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@ class HTTPProtocol(Protocol):
2121

2222
def get(self, url: str, **kw) -> Response:
2323
"""Send HTTP GET request"""
24-
...
2524

2625
def put(self, url: str, **kw) -> Response:
2726
"""Send HTTP PUT request"""
28-
...
2927

3028
def post(self, url: str, **kw) -> Response:
3129
"""Send HTTP POST request"""
32-
...
3330

3431
def patch(self, url: str, **kw) -> Response:
3532
"""Send HTTP PATCH request"""
36-
...
3733

3834
def delete(self, url: str, **kw) -> Response:
3935
"""Send HTTP DELETE request"""
40-
...

circuitpython_typing/io.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def value(self) -> float:
3838
on the specifics of the class.
3939
"""
4040

41+
# pylint: disable=no-self-use,unused-argument
4142
@value.setter
4243
def value(self, input_value: float, /):
4344
...

circuitpython_typing/led.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class ColorBasedLED(Protocol):
2424

2525
def color(self, value: ColorBasedColorUnion) -> None:
2626
"""Sets the color of the LED"""
27-
...
2827

2928

3029
class FillBasedLED(Protocol):
3130
"""Protocol for LEDs using the :meth:`fill` method"""
3231

3332
def fill(self, color: FillBasedColorUnion) -> None:
3433
"""Sets the color of the LED"""
35-
...

circuitpython_typing/pil.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class PixelAccess(Protocol):
2121
# pylint: disable=invalid-name
2222
def __getitem__(self, xy: Tuple[int, int]) -> int:
2323
"""Get pixels by x, y coordinate"""
24-
...
2524

2625

2726
class Image(Protocol):
@@ -30,13 +29,10 @@ class Image(Protocol):
3029
@property
3130
def mode(self) -> str:
3231
"""The mode of the image"""
33-
...
3432

3533
@property
3634
def size(self) -> Tuple[int, int]:
3735
"""The size of the image"""
38-
...
3936

4037
def load(self) -> PixelAccess:
4138
"""Load the image for quick pixel access"""
42-
...

circuitpython_typing/pwmio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class PWMOut(Protocol):
2121
@property
2222
def duty_cycle(self) -> int:
2323
"""The duty cycle as a ratio using 16-bits"""
24-
...
2524

25+
# pylint: disable=no-self-use,unused-argument
2626
@duty_cycle.setter
2727
def duty_cycle(self, duty_cycle: int) -> None:
2828
...

circuitpython_typing/socket.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,12 @@ class CommonSocketType(Protocol):
4141
def send(self, data: bytes, flags: int = ...) -> None:
4242
"""Send data to the socket. The meaning of the optional flags kwarg is
4343
implementation-specific."""
44-
...
4544

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

5048
def close(self) -> None:
5149
"""Close the socket."""
52-
...
5350

5451

5552
class CommonCircuitPythonSocketType(CommonSocketType, Protocol):
@@ -62,7 +59,6 @@ def connect(
6259
) -> None:
6360
"""Connect to a remote socket at the provided (host, port) address. The conntype
6461
kwarg optionally may indicate SSL or not, depending on the underlying interface."""
65-
...
6662

6763

6864
class LegacyCircuitPythonSocketType(CommonCircuitPythonSocketType, Protocol):
@@ -72,7 +68,6 @@ def recv(self, bufsize: int = ...) -> bytes:
7268
"""Receive data from the socket. The return value is a bytes object representing
7369
the data received. The maximum amount of data to be received at once is specified
7470
by bufsize."""
75-
...
7671

7772

7873
class SupportsRecvWithFlags(Protocol):
@@ -82,7 +77,6 @@ def recv(self, bufsize: int = ..., flags: int = ...) -> bytes:
8277
"""Receive data from the socket. The return value is a bytes object representing
8378
the data received. The maximum amount of data to be received at once is specified
8479
by bufsize. The meaning of the optional flags kwarg is implementation-specific."""
85-
...
8680

8781

8882
class SupportsRecvInto(Protocol):
@@ -93,7 +87,6 @@ def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> i
9387
buffer. If nbytes is not specified (or 0), receive up to the size available in the
9488
given buffer. The meaning of the optional flags kwarg is implementation-specific.
9589
Returns the number of bytes received."""
96-
...
9790

9891

9992
class CircuitPythonSocketType(
@@ -104,8 +97,6 @@ class CircuitPythonSocketType(
10497
): # pylint: disable=too-many-ancestors
10598
"""Describes the structure every modern CircuitPython socket type must have."""
10699

107-
...
108-
109100

110101
class StandardPythonSocketType(
111102
CommonSocketType, SupportsRecvInto, SupportsRecvWithFlags, Protocol
@@ -114,7 +105,6 @@ class StandardPythonSocketType(
114105

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

119109

120110
SocketType: TypeAlias = Union[
@@ -132,7 +122,6 @@ class InterfaceType(Protocol):
132122
@property
133123
def TLS_MODE(self) -> int: # pylint: disable=invalid-name
134124
"""Constant representing that a socket's connection mode is TLS."""
135-
...
136125

137126

138127
SSLContextType: TypeAlias = Union[SSLContext, "_FakeSSLContext"]

0 commit comments

Comments
 (0)