当我看到ip地址文档:IPv4Address.compressed意为ip地址
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.compressed
当我看到IPv4Address.compressed
,我发现有针对compressed
没有解释。
谁能告诉我这是什么意思?
从source code,只有Return the shorthand version of the IP address as a string.
解释,我没有很好地理解shorthand version of the IP address
。
我会想它会从127.0.0.1中省略可选零来产生127.1,但它不会。也许它对IPv6更有用,包括IPv4的正交性。我看到它在做这个页面描述的IPv6:https://networklessons.com/ipv6/shortening-ipv6-addresses/ – tripleee
@tripleee这很有道理,因为IPv4对象有很多模仿IPv6对象的属性。 – aircraft