MACADDR(3)
β¨ MACADDR β¨
okay bestie, so this is the macaddr page from the macaddr 1.0.1 manual (section 3, library functions, you know the vibe π
) and it's literally all about the packet.link.macaddr MacAddr module. it's short, it's sweet, and it's giving extremely useful. let's get into it π¦
πΈ NAME πΈ
packet.link.macaddr β the MacAddr module. that's it, that's the whole name, and honestly? iconic π
π DESCRIPTION π
so what you do is you create an object that represents a MAC address. and how do you feed it that address? two ways, bestie: either as a series of hexadecimal numbers, or using the classic ":" notation. pick your fighter π
and here's the cute part β it also gives you a whole mechanism for comparing this object with a regular string. so your MacAddr object and your plain old strings can justβ¦ chat. vibe check passed β¨
π CLASSES π
π class MacAddr(builtins.str)
a MacAddr address object. it's literally a subclass of builtins.str, so you already know it's got string energy fr fr.
Usage:
from packet.link.macaddr import MacAddr
mac = MacAddr('E4CE8F589FF4')
and here's the slay: the following expressions are equivalent π«Ά
mac == 'E4CE8F589FF4'
mac == 'e4ce8f589ff4'
mac == 'e4:ce:8f:58:9f:f4'
like, all three of those hit the same. case? doesn't matter. colons? don't care. that's the whole point, bestie ππ
π₯ Methods defined here:
__eq__(self, other)β compares two MAC addresses and returnsTrueif both are equal. that's it. no notes.__ne__(self, other)β compares two MAC addresses and returnsFalseif both are equal. yeah it's the opposite one, we love a matching set π
β Static methods defined here:
__new__(cls, mac)β creates a new instance by converting the input string into a persistent representation of a MAC address. so you hand it a string, it hands you back the glow-up version. main character energy honestly π
π BUGS π
no known bugs. we ate and left no crumbs. periodt π
π«Ά AUTHOR π«Ά
Jorge Mora (mora@netapp.com) β thank you for your service, king π
and that's the whole page! this was pulled from NFStest 3.2, dated 21 March 2023. bye bestie, go compare some MAC addresses, ily π¦π
π¦ 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