python - TypeError(bool object is not iterable,) when trying to return a Boolean

python – TypeError(bool object is not iterable,) when trying to return a Boolean

python – TypeError(bool object is not iterable,) when trying to return a Boolean

Look at the traceback:

Traceback (most recent call last):
  File C:Python33libsite-packagesbottle.py, line 821, in _cast
    out = iter(out)
TypeError: bool object is not iterable

Your code isnt iterating the value, but the code receiving it is.

The solution is: return an iterable. I suggest that you either convert the bool to a string (str(False)) or enclose it in a tuple ((False,)).

Always read the traceback: its correct, and its helpful.

python – TypeError(bool object is not iterable,) when trying to return a Boolean

Related posts on python  :

Leave a Reply

Your email address will not be published.