title: I cannot understand a case of passing an object as a parameter
body: <p>I have a class Node with a function defined</p>
  
  <pre><code>class Node(object):
      def __init__(self, index, state = None, input = None, directed_neighbours=False):
         """
         Parameters
         ----------
         index : int
          Node index. Must be unique in the graph.
         """
         self._input = input
         self.state = state
         #self._status = 'active'
         self._index = int(index)
         self._neighbours = set()
         self._port_count = 0
         self._ports = []
         if directed_neighbours:
             self._predecessors = set()
             self._successors = self._neighbours
             self._directed_neighbours = True
         else:
             self._successors = self._neighbours
             self._predecessors = self._neighbours
             self._directed_neighbours = False
  
      @property
      def setStatus(self, status):
          self._status = status
  </code></pre>
  
  <p>I have another function </p>
  
  <pre><code>def init(node):
      node.setStatus('active')
  </code></pre>
  
  <p>Now, I have a class</p>
  
  <pre><code>class DistAlgo:
  
       def __init__(self, name, initFunc, states, messages, sendFunc, receiveFunc, stoppingCheck):
          self.name = name
          #self.inputGraph = inputGraph
          self.initFunc = initFunc
          self.states = states
          self.messages = messages
          self.sendFunc = sendFunc
          self.receiveFunc = receiveFunc
          self.comm_round = 0
          self.stoppingCheck = stoppingCheck
  
      def run(self, inputGraph):
  
          for node in inputGraph.nodes:
              print('hello', node)
              node.state = self.initFunc(node)
          &lt;....more code...&gt;
  </code></pre>
  
  <p>When I create an object of DistAlgo</p>
  
  <pre><code>myalgo = DistAlgo('BMM', init, states, messages, send, receive, stoppingCheck)
  </code></pre>
  
  <p>and then call its run function:</p>
  
  <pre><code>myalgo.run(problemGraph)
  </code></pre>
  
  <p>I get an error in the init function above, as:</p>
  
  <pre><code>TypeError: setStatus() missing 1 required positional argument: 'status'
  </code></pre>
  
  <p>I surely am doing more than one thing wrong I guess, as this is my first Python try. Please point them out!</p>