title: TypeError: __init__() takes exactly 2 arguments (3 given) Python
body: <p>I'm making app that will comunicate with microcontroller via UART and I encountered one problem. In function <code>connectBtnHandler</code> I'm creating <code>bh</code> object and when I'm calling this function it gives me error </p>
  
  <pre><code>File "motionPyCfg.py", line 82, in connectBtnHandler
      bh = boardHandler('/dev/ttyUSB0', 19200)
  TypeError: __init__() takes exactly 2 arguments (3 given)
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>def __init__(self, port, baudRate):
      self.ser = serial.Serial(port, baudrate = baudRate, parity = serial.PARITY_EVEN, 
      stopbits=serial.STOPBITS_ONE,bytesize=serial.EIGHTBITS)    
  </code></pre>
  
  <p>This is constructor of <code>boardHandler</code>, class from witch I'm creating <code>bh</code> object. As you can see there are 2 parameters but I'm still getting error that I'm giving 3 parameters. </p>
  
  <pre><code>def connectBtnHandler(self, event):  # wxGlade: MyFrame.&lt;event_handler&gt;
      port = str(self.portCombo.GetValue())
      baudrate = int(self.baudCombo.GetValue())
      print baudrate
      print port
      bh = boardHandler(port, baudrate)
      self.infoText.AppendText("Connected to: " + port + "\n")
      event.Skip()
  </code></pre>
  
  <p>This is function in witch I'm creating <code>bh</code> object.</p>