@@ -64,15 +64,12 @@ class CommonSocketType(Protocol):
6464 def send (self , data : bytes , flags : int = ...) -> None :
6565 """Send data to the socket. The meaning of the optional flags kwarg is
6666 implementation-specific."""
67- ...
6867
6968 def settimeout (self , value : Optional [float ]) -> None :
7069 """Set a timeout on blocking socket operations."""
71- ...
7270
7371 def close (self ) -> None :
7472 """Close the socket."""
75- ...
7673
7774 class CommonCircuitPythonSocketType (CommonSocketType , Protocol ):
7875 """Describes the common structure every CircuitPython socket type must have."""
@@ -84,7 +81,6 @@ def connect(
8481 ) -> None :
8582 """Connect to a remote socket at the provided (host, port) address. The conntype
8683 kwarg optionally may indicate SSL or not, depending on the underlying interface."""
87- ...
8884
8985 class LegacyCircuitPythonSocketType (CommonCircuitPythonSocketType , Protocol ):
9086 """Describes the structure a legacy CircuitPython socket type must have."""
@@ -93,7 +89,6 @@ def recv(self, bufsize: int = ...) -> bytes:
9389 """Receive data from the socket. The return value is a bytes object representing
9490 the data received. The maximum amount of data to be received at once is specified
9591 by bufsize."""
96- ...
9792
9893 class SupportsRecvWithFlags (Protocol ):
9994 """Describes a type that posseses a socket recv() method supporting the flags kwarg."""
@@ -102,7 +97,6 @@ def recv(self, bufsize: int = ..., flags: int = ...) -> bytes:
10297 """Receive data from the socket. The return value is a bytes object representing
10398 the data received. The maximum amount of data to be received at once is specified
10499 by bufsize. The meaning of the optional flags kwarg is implementation-specific."""
105- ...
106100
107101 class SupportsRecvInto (Protocol ):
108102 """Describes a type that possesses a socket recv_into() method."""
@@ -114,7 +108,6 @@ def recv_into(
114108 buffer. If nbytes is not specified (or 0), receive up to the size available in the
115109 given buffer. The meaning of the optional flags kwarg is implementation-specific.
116110 Returns the number of bytes received."""
117- ...
118111
119112 class CircuitPythonSocketType (
120113 CommonCircuitPythonSocketType ,
@@ -124,16 +117,13 @@ class CircuitPythonSocketType(
124117 ): # pylint: disable=too-many-ancestors
125118 """Describes the structure every modern CircuitPython socket type must have."""
126119
127- ...
128-
129120 class StandardPythonSocketType (
130121 CommonSocketType , SupportsRecvInto , SupportsRecvWithFlags , Protocol
131122 ):
132123 """Describes the structure every standard Python socket type must have."""
133124
134125 def connect (self , address : Union [Tuple [Any , ...], str , bytes ]) -> None :
135126 """Connect to a remote socket at the provided address."""
136- ...
137127
138128 SocketType = Union [
139129 LegacyCircuitPythonSocketType ,
@@ -149,7 +139,6 @@ class InterfaceType(Protocol):
149139 @property
150140 def TLS_MODE (self ) -> int : # pylint: disable=invalid-name
151141 """Constant representing that a socket's connection mode is TLS."""
152- ...
153142
154143 SSLContextType = Union [SSLContext , "_FakeSSLContext" ]
155144
0 commit comments