On this page
socket.AddressFamily
Up: socket | Next: socket.close
Rel: socket.close, socket.create_connection, socket.create_server, socket.dup
Ref: docs.python.org — socket.AddressFamily
Tags: #public #python3 #stdlib #socket
Import
import socket
from socket import AddressFamily
Signature & Overview
socket.AddressFamily(*values)
An enumeration.
Methods & Attributes
AddressFamily.as_integer_ratio(self, /)— Return a pair of integers, whose ratio is equal to the original int.AddressFamily.bit_count(self, /)— Number of ones in the binary representation of the absolute value of self.AddressFamily.bit_length(self, /)— Number of bits necessary to represent self in binary.AddressFamily.conjugate(self, /)— Returns self, the complex conjugate of any int.AddressFamily.from_bytes(bytes, byteorder='big', *, signed=False)— Return the integer represented by the given array of bytes.AddressFamily.is_integer(self, /)— Returns True. Exists for duck type compatibility with float.is_integer.AddressFamily.to_bytes(self, /, length=1, byteorder='big', *, signed=False)— Return an array of bytes representing an integer.
Usage
import socket
assert isinstance(socket.AF_INET, socket.AddressFamily)
assert socket.AF_INET6.name == "AF_INET6"
Gotchas
IntEnumof address families: Most common areAF_INET(IPv4),AF_INET6(IPv6), andAF_UNIX(local Unix sockets).
REPL Inspect
from socket import AddressFamily
help(AddressFamily)
Linked from
- tuts/python3/stdlib_module/socket
- tuts/python3/stdlib_module/socket/close
- tuts/python3/stdlib_module/socket/create_connection
- tuts/python3/stdlib_module/socket/create_server
- tuts/python3/stdlib_module/socket/dup
- tuts/python3/stdlib_module/socket/error
- tuts/python3/stdlib_module/socket/fromfd
- tuts/python3/stdlib_module/socket/gaierror
- tuts/python3/stdlib_module/socket/getaddrinfo
- tuts/python3/stdlib_module/socket/getdefaulttimeout
- tuts/python3/stdlib_module/socket/getfqdn
- tuts/python3/stdlib_module/socket/gethostbyaddr
- tuts/python3/stdlib_module/socket/gethostbyname
- tuts/python3/stdlib_module/socket/gethostbyname_ex
- tuts/python3/stdlib_module/socket/gethostname
- tuts/python3/stdlib_module/socket/getnameinfo
- tuts/python3/stdlib_module/socket/getprotobyname
- tuts/python3/stdlib_module/socket/getservbyname
- tuts/python3/stdlib_module/socket/getservbyport
- tuts/python3/stdlib_module/socket/has_dualstack_ipv6
- tuts/python3/stdlib_module/socket/herror
- tuts/python3/stdlib_module/socket/htonl
- tuts/python3/stdlib_module/socket/htons
- tuts/python3/stdlib_module/socket/if_indextoname
- tuts/python3/stdlib_module/socket/if_nameindex
- tuts/python3/stdlib_module/socket/if_nametoindex
- tuts/python3/stdlib_module/socket/inet_aton
- tuts/python3/stdlib_module/socket/inet_ntoa
- tuts/python3/stdlib_module/socket/inet_ntop
- tuts/python3/stdlib_module/socket/inet_pton
- tuts/python3/stdlib_module/socket/ntohl
- tuts/python3/stdlib_module/socket/ntohs
- tuts/python3/stdlib_module/socket/recv_fds
- tuts/python3/stdlib_module/socket/send_fds
- tuts/python3/stdlib_module/socket/setdefaulttimeout
- tuts/python3/stdlib_module/socket/sethostname
- tuts/python3/stdlib_module/socket/socket
- tuts/python3/stdlib_module/socket/SocketKind
- tuts/python3/stdlib_module/socket/socketpair
- tuts/python3/stdlib_module/socket/SocketType
- tuts/python3/stdlib_module/socket/timeout
Related notes
- tuts/python3/stdlib_module/socket/close Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_connection Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_server Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/dup Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/socket Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/error links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/fromfd links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/gaierror links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/getaddrinfo links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/getdefaulttimeout links to this page; shared tags: #socket, #stdlib