I am new to Python. I came across Python code in an OpenFlow controller that I am working on.
class SimpleSwitch(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_0.OFP_VERSION]
def __init__(self, *args, **kwargs):
super(SimpleSwitch, self).__init__(*args, **kwargs)
self.mac_to_port = {}
My questions are as follows.
Is
__init__
the constructor for a class?Is
self
the same as C++'sthis
pointer?Does
super(SimpleSwitch, self).__init__(*args, **kwargs)
mean calling constructor for parent/super class?Can you add a new member to
self
asmac_to_port
? Or has that been already added and just being initialized here?