Xavier de Gaye added the comment:

> In that case the behavior you are seeing is correct, even if not obvious or 
> even desirable.  It will happen any time you are looping over sys.modules and 
> call a function/method which has a function-scoped import statement for a 
> module that hasn't been imported yet (or calls another function that does so, 
> etc.).

I do not agree. Suppose there is some piece of code that loops over sys.modules 
without doing any lazy import (and thus without raising the RuntimeError 
"dictionary changed size during iteration"). Now, if you insert a 
pdb.set_trace() in that code, you will get the RuntimeError and this is not 
correct.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20703>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to