misc: Fix python scripts shebang line
[vpp.git] / src / vpp-api / python / vpp_papi / macaddress.py
index a100381..02c90db 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (c) 2016 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,3 +52,14 @@ class MACAddress():
 
     def __repr__(self):
         return '%s(%s)' % (self.__class__.__name__, self.mac_string)
+
+    def __eq__(self, other):
+        if not isinstance(other, MACAddress):
+            return NotImplemented
+        return self.mac_binary == other.mac_binary
+
+    def __ne__(self, other):
+        return not self == other
+
+    def __hash__(self):
+        return hash(self.mac_binary)