11from asyncio .events import AbstractEventLoop
22from asyncio .protocols import BaseProtocol
3- from collections .abc import Mapping
3+ from collections .abc import Iterable , Mapping
44from socket import _Address
55from typing import Any
66
77__all__ = ("BaseTransport" , "ReadTransport" , "WriteTransport" , "Transport" , "DatagramTransport" , "SubprocessTransport" )
88
99class BaseTransport :
10- def __init__ (self , extra : Mapping [Any , Any ] | None = ...) -> None : ...
11- def get_extra_info (self , name : Any , default : Any = ...) -> Any : ...
10+ def __init__ (self , extra : Mapping [str , Any ] | None = ...) -> None : ...
11+ def get_extra_info (self , name : str , default : Any = ...) -> Any : ...
1212 def is_closing (self ) -> bool : ...
1313 def close (self ) -> None : ...
1414 def set_protocol (self , protocol : BaseProtocol ) -> None : ...
@@ -23,16 +23,16 @@ class WriteTransport(BaseTransport):
2323 def set_write_buffer_limits (self , high : int | None = ..., low : int | None = ...) -> None : ...
2424 def get_write_buffer_size (self ) -> int : ...
2525 def get_write_buffer_limits (self ) -> tuple [int , int ]: ...
26- def write (self , data : Any ) -> None : ...
27- def writelines (self , list_of_data : list [ Any ]) -> None : ...
26+ def write (self , data : bytes ) -> None : ...
27+ def writelines (self , list_of_data : Iterable [ bytes ]) -> None : ...
2828 def write_eof (self ) -> None : ...
2929 def can_write_eof (self ) -> bool : ...
3030 def abort (self ) -> None : ...
3131
3232class Transport (ReadTransport , WriteTransport ): ...
3333
3434class DatagramTransport (BaseTransport ):
35- def sendto (self , data : Any , addr : _Address | None = ...) -> None : ...
35+ def sendto (self , data : bytes , addr : _Address | None = ...) -> None : ...
3636 def abort (self ) -> None : ...
3737
3838class SubprocessTransport (BaseTransport ):
@@ -44,4 +44,4 @@ class SubprocessTransport(BaseTransport):
4444 def kill (self ) -> None : ...
4545
4646class _FlowControlMixin (Transport ):
47- def __init__ (self , extra : Mapping [Any , Any ] | None = ..., loop : AbstractEventLoop | None = ...) -> None : ...
47+ def __init__ (self , extra : Mapping [str , Any ] | None = ..., loop : AbstractEventLoop | None = ...) -> None : ...
0 commit comments