For IPv4 addresses, two special forms are accepted instead of a host address: '' represents INADDR_ANY, which is used to bind to all interfaces, and the string '<broadcast>' represents INADDR_BROADCAST. This behavior is not compatible with IPv6, therefore, you may want to avoid these if you intend to support IPv6 with your Python programs.
It looks like CPython implements it in socketmodule.c:setipaddress()
Activity
rlippmann commented on May 19, 2023
I double checked, and it is valid python:
link
For IPv4 addresses, two special forms are accepted instead of a host address: '' represents INADDR_ANY, which is used to bind to all interfaces, and the string '<broadcast>' represents INADDR_BROADCAST. This behavior is not compatible with IPv6, therefore, you may want to avoid these if you intend to support IPv6 with your Python programs.
It looks like CPython implements it in socketmodule.c:setipaddress()
source
fantix commented on Jan 12, 2026
Fixed in #592
uvloop 0.23.0