[Python-ideas] revisit pep 377: good use case?
Jim Jewett
jimjjewett at gmail.com
Thu Mar 1 17:39:53 CET 2012
On Thu, Mar 1, 2012 at 12:32 AM, Craig Yoshioka <craigyk at me.com> wrote:
<craigyk at me.com> wrote:
> except PEP 377 failed partially because there wasn't a concrete
> real-world example of where it would be useful.
But do you have one?
I understand that you want the context to make the decision, instead
of counting on a caller to do it properly. But why can't you do that
with a decorator instead of a context? I think your examples are
covered by http://wiki.python.org/moin/PythonDecoratorLibrary#Memoize
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?
-jJ
More information about the Python-ideas
mailing list