1- # ruff: noqa: PYI063 # Several cases throughout file where
2- # argument names with __ used because of typeshed, see comment for recv in _SocketType
3-
41from __future__ import annotations
52
63import os
@@ -677,11 +674,12 @@ async def accept(self) -> tuple[SocketType, AddressFormat]:
677674 async def connect (self , address : AddressFormat ) -> None :
678675 raise NotImplementedError
679676
680- def recv (__self , __buflen : int , __flags : int = 0 ) -> Awaitable [bytes ]:
677+ def recv (self , buflen : int , flags : int = 0 , / ) -> Awaitable [bytes ]:
681678 raise NotImplementedError
682679
683680 def recv_into (
684- __self ,
681+ self ,
682+ / ,
685683 buffer : Buffer ,
686684 nbytes : int = 0 ,
687685 flags : int = 0 ,
@@ -690,15 +688,17 @@ def recv_into(
690688
691689 # return type of socket.socket.recvfrom in typeshed is tuple[bytes, Any]
692690 def recvfrom (
693- __self ,
694- __bufsize : int ,
695- __flags : int = 0 ,
691+ self ,
692+ bufsize : int ,
693+ flags : int = 0 ,
694+ / ,
696695 ) -> Awaitable [tuple [bytes , AddressFormat ]]:
697696 raise NotImplementedError
698697
699698 # return type of socket.socket.recvfrom_into in typeshed is tuple[bytes, Any]
700699 def recvfrom_into (
701- __self ,
700+ self ,
701+ / ,
702702 buffer : Buffer ,
703703 nbytes : int = 0 ,
704704 flags : int = 0 ,
@@ -710,10 +710,11 @@ def recvfrom_into(
710710 ):
711711
712712 def recvmsg (
713- __self ,
714- __bufsize : int ,
715- __ancbufsize : int = 0 ,
716- __flags : int = 0 ,
713+ self ,
714+ bufsize : int ,
715+ ancbufsize : int = 0 ,
716+ flags : int = 0 ,
717+ / ,
717718 ) -> Awaitable [tuple [bytes , list [tuple [int , int , bytes ]], int , object ]]:
718719 raise NotImplementedError
719720
@@ -722,29 +723,32 @@ def recvmsg(
722723 ):
723724
724725 def recvmsg_into (
725- __self ,
726- __buffers : Iterable [Buffer ],
727- __ancbufsize : int = 0 ,
728- __flags : int = 0 ,
726+ self ,
727+ buffers : Iterable [Buffer ],
728+ ancbufsize : int = 0 ,
729+ flags : int = 0 ,
730+ / ,
729731 ) -> Awaitable [tuple [int , list [tuple [int , int , bytes ]], int , object ]]:
730732 raise NotImplementedError
731733
732- def send (__self , __bytes : Buffer , __flags : int = 0 ) -> Awaitable [int ]:
734+ def send (self , bytes : Buffer , flags : int = 0 , / ) -> Awaitable [int ]:
733735 raise NotImplementedError
734736
735737 @overload
736738 async def sendto (
737739 self ,
738- __data : Buffer ,
739- __address : tuple [object , ...] | str | Buffer ,
740+ data : Buffer ,
741+ address : tuple [object , ...] | str | Buffer ,
742+ / ,
740743 ) -> int : ...
741744
742745 @overload
743746 async def sendto (
744747 self ,
745- __data : Buffer ,
746- __flags : int ,
747- __address : tuple [object , ...] | str | Buffer ,
748+ data : Buffer ,
749+ flags : int ,
750+ address : tuple [object , ...] | str | Buffer ,
751+ / ,
748752 ) -> int : ...
749753
750754 async def sendto (self , * args : object ) -> int :
@@ -757,10 +761,11 @@ async def sendto(self, *args: object) -> int:
757761 @_wraps (_stdlib_socket .socket .sendmsg , assigned = (), updated = ())
758762 async def sendmsg (
759763 self ,
760- __buffers : Iterable [Buffer ],
761- __ancdata : Iterable [tuple [int , int , Buffer ]] = (),
762- __flags : int = 0 ,
763- __address : AddressFormat | None = None ,
764+ buffers : Iterable [Buffer ],
765+ ancdata : Iterable [tuple [int , int , Buffer ]] = (),
766+ flags : int = 0 ,
767+ address : AddressFormat | None = None ,
768+ / ,
764769 ) -> int :
765770 raise NotImplementedError
766771
@@ -1118,11 +1123,8 @@ async def connect(self, address: AddressFormat) -> None:
11181123 # complain about AmbiguousType
11191124 if TYPE_CHECKING :
11201125
1121- def recv (__self , __buflen : int , __flags : int = 0 ) -> Awaitable [bytes ]: ...
1126+ def recv (self , buflen : int , flags : int = 0 , / ) -> Awaitable [bytes ]: ...
11221127
1123- # _make_simple_sock_method_wrapper is typed, so this checks that the above is correct
1124- # this requires that we refrain from using `/` to specify pos-only
1125- # args, or mypy thinks the signature differs from typeshed.
11261128 recv = _make_simple_sock_method_wrapper (
11271129 _stdlib_socket .socket .recv ,
11281130 _core .wait_readable ,
@@ -1135,7 +1137,8 @@ def recv(__self, __buflen: int, __flags: int = 0) -> Awaitable[bytes]: ...
11351137 if TYPE_CHECKING :
11361138
11371139 def recv_into (
1138- __self ,
1140+ self ,
1141+ / ,
11391142 buffer : Buffer ,
11401143 nbytes : int = 0 ,
11411144 flags : int = 0 ,
@@ -1153,9 +1156,10 @@ def recv_into(
11531156 if TYPE_CHECKING :
11541157 # return type of socket.socket.recvfrom in typeshed is tuple[bytes, Any]
11551158 def recvfrom (
1156- __self ,
1157- __bufsize : int ,
1158- __flags : int = 0 ,
1159+ self ,
1160+ bufsize : int ,
1161+ flags : int = 0 ,
1162+ / ,
11591163 ) -> Awaitable [tuple [bytes , AddressFormat ]]: ...
11601164
11611165 recvfrom = _make_simple_sock_method_wrapper (
@@ -1170,7 +1174,8 @@ def recvfrom(
11701174 if TYPE_CHECKING :
11711175 # return type of socket.socket.recvfrom_into in typeshed is tuple[bytes, Any]
11721176 def recvfrom_into (
1173- __self ,
1177+ self ,
1178+ / ,
11741179 buffer : Buffer ,
11751180 nbytes : int = 0 ,
11761181 flags : int = 0 ,
@@ -1191,10 +1196,11 @@ def recvfrom_into(
11911196 if TYPE_CHECKING :
11921197
11931198 def recvmsg (
1194- __self ,
1195- __bufsize : int ,
1196- __ancbufsize : int = 0 ,
1197- __flags : int = 0 ,
1199+ self ,
1200+ bufsize : int ,
1201+ ancbufsize : int = 0 ,
1202+ flags : int = 0 ,
1203+ / ,
11981204 ) -> Awaitable [tuple [bytes , list [tuple [int , int , bytes ]], int , object ]]: ...
11991205
12001206 recvmsg = _make_simple_sock_method_wrapper (
@@ -1213,10 +1219,11 @@ def recvmsg(
12131219 if TYPE_CHECKING :
12141220
12151221 def recvmsg_into (
1216- __self ,
1217- __buffers : Iterable [Buffer ],
1218- __ancbufsize : int = 0 ,
1219- __flags : int = 0 ,
1222+ self ,
1223+ buffers : Iterable [Buffer ],
1224+ ancbufsize : int = 0 ,
1225+ flags : int = 0 ,
1226+ / ,
12201227 ) -> Awaitable [tuple [int , list [tuple [int , int , bytes ]], int , object ]]: ...
12211228
12221229 recvmsg_into = _make_simple_sock_method_wrapper (
@@ -1231,7 +1238,7 @@ def recvmsg_into(
12311238
12321239 if TYPE_CHECKING :
12331240
1234- def send (__self , __bytes : Buffer , __flags : int = 0 ) -> Awaitable [int ]: ...
1241+ def send (self , bytes : Buffer , flags : int = 0 , / ) -> Awaitable [int ]: ...
12351242
12361243 send = _make_simple_sock_method_wrapper (
12371244 _stdlib_socket .socket .send ,
@@ -1245,16 +1252,18 @@ def send(__self, __bytes: Buffer, __flags: int = 0) -> Awaitable[int]: ...
12451252 @overload
12461253 async def sendto (
12471254 self ,
1248- __data : Buffer ,
1249- __address : tuple [object , ...] | str | Buffer ,
1255+ data : Buffer ,
1256+ address : tuple [object , ...] | str | Buffer ,
1257+ / ,
12501258 ) -> int : ...
12511259
12521260 @overload
12531261 async def sendto (
12541262 self ,
1255- __data : Buffer ,
1256- __flags : int ,
1257- __address : tuple [object , ...] | str | Buffer ,
1263+ data : Buffer ,
1264+ flags : int ,
1265+ address : tuple [object , ...] | str | Buffer ,
1266+ / ,
12581267 ) -> int : ...
12591268
12601269 @_wraps (_stdlib_socket .socket .sendto , assigned = (), updated = ())
@@ -1287,6 +1296,7 @@ async def sendmsg(
12871296 ancdata : Iterable [tuple [int , int , Buffer ]] = (),
12881297 flags : int = 0 ,
12891298 address : AddressFormat | None = None ,
1299+ / ,
12901300 ) -> int :
12911301 """Similar to :meth:`socket.socket.sendmsg`, but async.
12921302
0 commit comments