【发布时间】:2017-12-18 07:48:32
【问题描述】:
当我阅读 ipaddress 文档时:
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:networklessons.com/ipv6/shortening-ipv6-addresses
-
@tripleee 有道理,因为 IPv4 对象有很多模仿 IPv6 对象的属性。
标签: python ip-address