title: TypeError("'bool' object is not iterable",) when trying to return a Boolean
body: <p>I am having a strange problem. I have a method that returns a boolean. In turn I need the result of that function returned again since I cant directly call the method from the front-end. Here's my code:</p>
  
  <pre><code># this uses bottle py framework and should return a value to the html front-end
  @get('/create/additive/&lt;name&gt;')
  def createAdditive(name):
      return pump.createAdditive(name)
  
  
  
   def createAdditive(self, name):
          additiveInsertQuery = """ INSERT INTO additives
                                    SET         name = '""" + name + """'"""
          try:
              self.cursor.execute(additiveInsertQuery)
              self.db.commit()
              return True
          except:
              self.db.rollback()
              return False
  </code></pre>
  
  <p>This throws an exception: TypeError("'bool' object is not iterable",)</p>
  
  <p>I don't get this error at all since I am not attempting to "iterate" the bool value, only to return it.</p>
  
  <p>If I return a string instead of boolean or int it works as expected. What could be an issue here?</p>
  
  <p><strong>Traceback:</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python33\lib\site-packages\bottle.py", line 821, in _cast
      out = iter(out)
  TypeError: 'bool' object is not iterable
  </code></pre>