Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python create a set of class

class GlobeLearningTable(object):
    def __init__(self,mac,port,dpid):
        self.mac = mac
        self.port = port
        self.dpid = dpid

    def __hash__(self):
        return hash((self.mac, self.port, self.dpid))

    def __eq__(self, other):
        if not isinstance(other, type(self)): return NotImplemented
        return self.mac == other.mac and self.port == other.port and self.dpid == other.dpid
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #create #set #class
ADD COMMENT
Topic
Name
1+4 =