[Python-ideas] revisit pep 377: good use case?

Jim Jewett jimjjewett at gmail.com
Mon Mar 5 17:44:37 CET 2012

On Thu, Mar 1, 2012 at 11:39 AM, Jim Jewett <jimjjewett at gmail.com> wrote:

> Is it just that you want the stuff inside both your function and your
> context manager/decorator to have access to the same locals, and don't
> want to use a closure and/or pass around a dict?

It turned out that one important piece was that what a user considered
a function was too large of a chunk for appropriate caching.  That is
an argument for a suite decorator, so as to avoid boilerplate code
around each call.

I'm not sure how *strong* the argument is though, because at least in
his particular case, the cachable parts are sufficiently similar that
they can be wrapped inside a calls to a "service provider", and the
boilerplate can *probably* be moved there.


More information about the Python-ideas mailing list