[issue29518] 'for' loop not automatically breaking (index error on line of loop header)

Steven D'Aprano report at bugs.python.org
Fri Feb 10 05:53:03 EST 2017


Steven D'Aprano added the comment:

I agree with Josh: the exception you are giving doesn't seem possible with the code snippet shown. Please COPY AND PASTE (not a screen shot) the text of the entire traceback, starting with the line "Traceback..."

I suspect that you may have shadowed the built-in range or len object with some custom object, but I could be completely wrong. But without more information, we cannot tell what is going on.

It would be really useful if you could provide a minimal (short as possible) script that reproduces the problem. And please confirm that you can reproduce the problem in the regular CPython interpreter, without using any third-party IDEs.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29518>
_______________________________________


More information about the Python-bugs-list mailing list