Message339227
Not sure that I agree there is a testing need to clear all caches regardless of what they do. Test code should explicitly state whether it relies on a particular cache being cleared at some particular point in time.
Also, the concept of "need to clear all caches" isn't well-formed. Would you want sys.intern caches to be cleared? What about the internal caches in SQLite?
And do you think polling for a new magic attribute is the right approach? We would get looser coupling and better control by letting modules register themselves as needed.
--- re.py ---
sys.register_cache_clear_function(callback=purge, doc='pattern cache and re cache')
--- ipaddress.py --
sys.register(IPv4Address.is_private.is_getter.cache_clear, doc='check for private networks) |
|
Date |
User |
Action |
Args |
2019-03-30 22:47:06 | rhettinger | set | recipients:
+ rhettinger, brett.cannon, ezio.melotti, michael.foord, serhiy.storchaka |
2019-03-30 22:47:06 | rhettinger | set | messageid: <1553986026.11.0.957214147452.issue36485@roundup.psfhosted.org> |
2019-03-30 22:47:06 | rhettinger | link | issue36485 messages |
2019-03-30 22:47:06 | rhettinger | create | |
|