R. David Murray added the comment: Yes, the behavior here is "undefined" at the language level. And as pyos says, technically it is documented: if you mutate the object over which you are iterating inside the iteration context (a for loop is just one example of same), the behavior is explicitly undefined. I agree that it is not *obvious* that that applies to chain.from_iterable in this context, but I'm not sure how we'd improve the docs to cover it.
---------- nosy: +r.david.murray _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16791> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com