Author rhettinger
Recipients brett.cannon, ezio.melotti, michael.foord, rhettinger, serhiy.storchaka
Date 2019-03-30.22:47:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553986026.11.0.957214147452.issue36485@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2019-03-30 22:47:06rhettingersetrecipients: + rhettinger, brett.cannon, ezio.melotti, michael.foord, serhiy.storchaka
2019-03-30 22:47:06rhettingersetmessageid: <1553986026.11.0.957214147452.issue36485@roundup.psfhosted.org>
2019-03-30 22:47:06rhettingerlinkissue36485 messages
2019-03-30 22:47:06rhettingercreate