Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> Did you mean importlib.reload() instead of sys.reload()?

Yes.

> And technically it would *if* you're okay with the other 
> side-effects of reloading,

If you want to go forward with this, go for it. I would like to be able to 
explain to another person why this is needed, but personally can't visualize a 
circumstance where a person is testing module, doesn't know how to use the 
existing cache clearing APIs, but needs to clear caches (not sure why), and 
doesn't either know or want what happens on import.  I've never seen this 
situation arise, but if it's something you want, I won't stand it the way.

BTW, if you're going to have some sort of clear_all(), perhaps it should cover 
the sys.intern() dictionary and string hashes as well.  AFAICT, there's nothing 
special about a regex cache that gives it a greater need to be cleared

----------

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

Reply via email to