macaddress
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: macaddress | ||
| Version: 2.0.0 | ||
| Version: 2.0.1 | ||
| Summary: Like ``ipaddress``, but for hardware identifiers such as MAC addresses. | ||
@@ -56,3 +56,3 @@ Home-page: https://github.com/mentalisttraceur/python-macaddress | ||
| import macaddress | ||
| >>> import macaddress | ||
@@ -337,10 +337,10 @@ Classes are provided for the common hardware identifier | ||
| >>> some_values = [ | ||
| ... MAC('ff-ee-dd-01-02-03'), | ||
| ... MAC('ff-ee-00-99-88-77'), | ||
| ... MAC('ff-ee-dd-01-02-04'), | ||
| ... OUI('ff-ee-dd'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-03'), | ||
| ... macaddress.MAC('ff-ee-00-99-88-77'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-04'), | ||
| ... macaddress.OUI('ff-ee-dd'), | ||
| ... ] | ||
| >>> for x in sorted(some_values): | ||
| ... print(x) | ||
| FF-EE-00-01-02-03 | ||
| FF-EE-00-99-88-77 | ||
| FF-EE-DD | ||
@@ -347,0 +347,0 @@ FF-EE-DD-01-02-03 |
+7
-7
@@ -14,3 +14,3 @@ # SPDX-License-Identifier: 0BSD | ||
| ) | ||
| __version__ = '2.0.0' | ||
| __version__ = '2.0.1' | ||
@@ -110,7 +110,7 @@ | ||
| elif isinstance(address, type(self)): | ||
| self._address = address._address | ||
| self._address = int(address) | ||
| # Superclass being "cast" to subclass: | ||
| elif (isinstance(address, HWAddress) | ||
| and isinstance(self, type(address))): | ||
| self._address = address._address | ||
| self._address = int(address) | ||
| else: | ||
@@ -134,3 +134,3 @@ raise _type_error(address, type(self)) | ||
| offset = (4 - type(self).size) & 3 | ||
| unconsumed_address_value = self._address << offset | ||
| unconsumed_address_value = int(self) << offset | ||
| for character in reversed(formats[0]): | ||
@@ -149,3 +149,3 @@ if character == 'x': | ||
| size_in_bytes = (type(self).size + 7) >> 3 | ||
| return (self._address << offset).to_bytes(size_in_bytes, 'big') | ||
| return (int(self) << offset).to_bytes(size_in_bytes, 'big') | ||
@@ -164,3 +164,3 @@ def __int__(self): | ||
| return NotImplemented | ||
| return type(self) == type(other) and self._address == other._address | ||
| return type(self) == type(other) and int(self) == int(other) | ||
@@ -196,3 +196,3 @@ def __lt__(self, other): | ||
| """Get the hash of this hardware address.""" | ||
| return hash((type(self), self._address)) | ||
| return hash((type(self), int(self))) | ||
@@ -199,0 +199,0 @@ |
+7
-7
| Metadata-Version: 2.1 | ||
| Name: macaddress | ||
| Version: 2.0.0 | ||
| Version: 2.0.1 | ||
| Summary: Like ``ipaddress``, but for hardware identifiers such as MAC addresses. | ||
@@ -56,3 +56,3 @@ Home-page: https://github.com/mentalisttraceur/python-macaddress | ||
| import macaddress | ||
| >>> import macaddress | ||
@@ -337,10 +337,10 @@ Classes are provided for the common hardware identifier | ||
| >>> some_values = [ | ||
| ... MAC('ff-ee-dd-01-02-03'), | ||
| ... MAC('ff-ee-00-99-88-77'), | ||
| ... MAC('ff-ee-dd-01-02-04'), | ||
| ... OUI('ff-ee-dd'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-03'), | ||
| ... macaddress.MAC('ff-ee-00-99-88-77'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-04'), | ||
| ... macaddress.OUI('ff-ee-dd'), | ||
| ... ] | ||
| >>> for x in sorted(some_values): | ||
| ... print(x) | ||
| FF-EE-00-01-02-03 | ||
| FF-EE-00-99-88-77 | ||
| FF-EE-DD | ||
@@ -347,0 +347,0 @@ FF-EE-DD-01-02-03 |
+6
-6
@@ -42,3 +42,3 @@ macaddress | ||
| import macaddress | ||
| >>> import macaddress | ||
@@ -323,10 +323,10 @@ Classes are provided for the common hardware identifier | ||
| >>> some_values = [ | ||
| ... MAC('ff-ee-dd-01-02-03'), | ||
| ... MAC('ff-ee-00-99-88-77'), | ||
| ... MAC('ff-ee-dd-01-02-04'), | ||
| ... OUI('ff-ee-dd'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-03'), | ||
| ... macaddress.MAC('ff-ee-00-99-88-77'), | ||
| ... macaddress.MAC('ff-ee-dd-01-02-04'), | ||
| ... macaddress.OUI('ff-ee-dd'), | ||
| ... ] | ||
| >>> for x in sorted(some_values): | ||
| ... print(x) | ||
| FF-EE-00-01-02-03 | ||
| FF-EE-00-99-88-77 | ||
| FF-EE-DD | ||
@@ -333,0 +333,0 @@ FF-EE-DD-01-02-03 |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
39745
0.29%