當我看到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