From f4811b0b42f10aa12fc2f94c0459344d84c89eb8 Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Sun, 25 Dec 2022 19:49:15 +0300 Subject: [PATCH] docs/library/socket: Use correct sockaddr variable name. Signed-off-by: Dorukyum --- docs/library/socket.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/library/socket.rst b/docs/library/socket.rst index 1d1c23abd1..944e7e631a 100644 --- a/docs/library/socket.rst +++ b/docs/library/socket.rst @@ -29,7 +29,7 @@ returned by `getaddrinfo` function, which must be used to resolve textual addres # You must use getaddrinfo() even for numeric addresses sockaddr = socket.getaddrinfo('127.0.0.1', 80)[0][-1] # Now you can use that address - sock.connect(addr) + sock.connect(sockaddr) Using `getaddrinfo` is the most efficient (both in terms of memory and processing power) and portable way to work with addresses.