Skip to content

asyncio: fix for py311 #7314

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

Closed
wants to merge 1 commit into from
Closed
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
46 changes: 31 additions & 15 deletions stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,37 @@ class AbstractEventLoop:
ssl: _SSLContext = ...,
) -> Server: ...

@abstractmethod
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
*,
family: int = ...,
proto: int = ...,
flags: int = ...,
reuse_address: bool | None = ...,
reuse_port: bool | None = ...,
allow_broadcast: bool | None = ...,
sock: socket | None = ...,
) -> tuple[BaseTransport, _ProtocolT]: ...
if sys.version_info >= (3, 11):
@abstractmethod
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
*,
family: int = ...,
proto: int = ...,
flags: int = ...,
reuse_port: bool | None = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On freshly pulled cpython's main branch, I get:

akuli@akuli-desktop:~/sourcestuff/cpython$ grep -A4 'def create_datagram_endpoint' Lib/asyncio/events.py 
    async def create_datagram_endpoint(self, protocol_factory,
                                       local_addr=None, remote_addr=None, *,
                                       family=0, proto=0, flags=0,
                                       reuse_address=None, reuse_port=None,
                                       allow_broadcast=None, sock=None):

So it seems like reuse_address was not removed. Am I missing something?

allow_broadcast: bool | None = ...,
sock: socket | None = ...,
) -> tuple[BaseTransport, _ProtocolT]: ...
else:
@abstractmethod
async def create_datagram_endpoint(
self,
protocol_factory: Callable[[], _ProtocolT],
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
*,
family: int = ...,
proto: int = ...,
flags: int = ...,
reuse_address: bool | None = ...,
reuse_port: bool | None = ...,
allow_broadcast: bool | None = ...,
sock: socket | None = ...,
) -> tuple[BaseTransport, _ProtocolT]: ...
# Pipes and subprocesses.
@abstractmethod
async def connect_read_pipe(
Expand Down