This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: TypeError message on bad iteration is misleading
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, georg.brandl, roysmith
Priority: low Keywords:

Created on 2005-04-21 14:58 by roysmith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg25091 - (view) Author: Roy Smith (roysmith) Date: 2005-04-21 14:58
>>> for i in 5:
...     pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: iteration over non-sequence

I know this is kind of a trivial point, but the message
"iteration of non-sequence" should really be something
like "iteration of non-iterable object", since not all
iterable things are sequences.
msg25092 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-06-05 10:46
Logged In: YES 
user_id=1188172

Seems reasonable to me.
msg25093 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-11-06 07:48
Logged In: YES 
user_id=849994

The message is "<type> object is not iterable" in Python 2.5.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41887
2005-04-21 14:58:14roysmithcreate