IPV6ADDR(3)
β¨ IPV6ADDR(3) β¨
okay bestie, welcome to the ipv6addr manual, version 1.1 β yes it's a real section 3 page, yes we're doing this, and yes it's gonna be cute π
π NAME π
packet.internet.ipv6addr β the IPv6Addr module, no cap π
π¦ DESCRIPTION π¦
So the whole vibe here? You make an object that represents an IPv6 address. You can hand it the address either as a series of hexadecimal numbers or using the : notation β both are valid, pick your fighter π
It also gives you a way to compare this object against a regular string. And because it's a generous icon, it handles the :: notation and leading zeroes for you, so you don't have to sit there counting zeros like it's a math final π
π CLASSES π
πΈ class IPv6Addr(builtins.str) πΈ
Your actual IPv6Addr address object. It's giving str energy, because it literally is one π
Usage:
from packet.internet.ipv6addr import IPv6Addr
ip = IPv6Addr('fe80000000000000020c29fffe5409ef')
And now the part that genuinely ate β all of these expressions are equivalent, like every single one of them hits the same π―
ip == 0xFE80000000000000020C29FFFE5409EF
ip == 0xfe80000000000000020c29fffe5409ef
ip == '0xFE80000000000000020C29FFFE5409EF'
ip == '0xfe80000000000000020c29fffe5409ef'
ip == 'FE80000000000000020C29FFFE5409EF'
ip == 'fe80000000000000020c29fffe5409ef'
ip == 'FE80:0000:0000:0000:020C:29FF:FE54:09EF'
ip == 'fe80:0000:0000:0000:020c:29ff:fe54:09ef'
ip == 'FE80::020C:29FF:FE54:09EF'
ip == 'fe80::020c:29ff:fe54:09ef'
ip == 'FE80::20C:29FF:FE54:9EF'
ip == 'fe80::20c:29ff:fe54:9ef'
Uppercase? lowercase? 0x prefix? full form? compressed :: form? leading zeroes or nah? it does not care bestie, it treats them all the same π«Ά
π« Methods defined here:
__eq__(self, other)β compares two IPv6 addresses and returnsTrueif both are equal π__ne__(self, other)β compares two IPv6 addresses and returnsFalseif both are equal. yes it's the little mirror gremlin of__eq__, that's just how it is π
β Static methods defined here:
__new__(cls, ip)β creates a new instance by converting the input int/string into a persistent representation of an IPv6 address. this is the β¨main characterβ¨ of the whole operation ngl
π BUGS π
No known bugs. periodt. we love a clean record π
π«Ά AUTHOR π«Ά
Jorge Mora (mora@netapp.com) β thank you for your service, king π
and that's the whole page bestie!! brought to you by NFStest 3.2, dated 21 March 2023 β iykyk, now go compare some addresses πβ¨π¦
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms