

Integer represents an octet (byte) in the address. The inclusive range 0–255, separated by dots (e.g. The following constitutes a valid IPv4 address:Ī string in decimal-dot notation, consisting of four decimal integers in IPv4Address ( address ) ¶Ĭonstruct an IPv4 address. Hashable, so they can be used as keys in dictionaries. Write code that handles both IP versions correctly.

Some attributes that are only meaningful for IPv6 addresses areĪlso implemented by IPv4Address objects, in order to make it easier to The IPv4Address and IPv6Address objects share a lot of commonĪttributes. Obtained by calling the appropriate version specific class constructorsĭirectly. Information on the precise error, as the functions don’t know whether the IPv4 and IPv6 formats means that error messages provide minimal One downside of these convenience functions is that the need to handle both ValueError is raised if address does not represent a valid IPv4 or Integers less than 2**32 will be considered to be IPv4 by default. Either IPv4 or IPv6 addresses may be supplied Return an IPv4Interface or IPv6Interface object depending
