[Python-ideas] Clear all caches
Guido van Rossum
guido at python.org
Wed Apr 1 17:35:32 CEST 2015
Actually several of these "caches" aren't caches at all -- deleting data
from them will break APIs. This is true at least for copyreg, the ABC
registry (though the things with cache in their names in ABC *are* proper
caches), and the mime types registry. Also urllib.request.urlcleanup()
removes the opener set by the install_opener() API.
On Wed, Apr 1, 2015 at 8:29 AM, Skip Montanaro <skip.montanaro at gmail.com>
wrote:
> The other elephant might be...
>
> If your caches can grow without bound so that programmers need to know
> about them (so they can clear them, in testing or other situations),
> then maybe they aren't well-designed. If cache growth is an issue, I'd
> rather see an abstract API for LRU (and other) cache types which
> intelligently cap cache size. I suspect that long before you hit the
> inevitable MemoryError, unbounded caches probably destroy program
> performance by causing large-scale swapping.
>
> Skip
>
--
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150401/bea85291/attachment-0001.html>
More information about the Python-ideas
mailing list