[Python-ideas] Unified style of cache management API
storchaka at gmail.com
Sat Mar 30 08:04:59 EDT 2019
29.03.19 20:52, Brett Cannon пише:
> On Thu, Mar 28, 2019 at 10:53 AM Serhiy Storchaka
> <storchaka at gmail.com
> <mailto:storchaka at gmail.com>> wrote:
> 28.03.19 19:45, Brett Cannon пише:
> > So I would say that a cache-clearing function convention would be a
> > reasonable starting point. If that turns out to not be enough for
> > we can talk about expanding it, but I think we should start small
> > grow from there as needed.
> > So what name would people want. clear_cache() or _clear_cache()? I
> > personally prefer the latter since clearing the cache shouldn't be
> > something people should typically need to do and thus the
> function is an
> > implementation detail.
> This is an interesting idea. I think it should be a dunder name:
> __clearcache__() or __clear_cache__().
> Between those two then I would go with __clearcache__(), but I was
> talking about a naming scheme for a function in each module, not a new
> built-in in case you thought I meant that.
Then I understood you correctly. Only now I saw that your words could
have been understood differently.
Opened https://bugs.python.org/issue36485 for implementing this idea.
More information about the Python-ideas