Python
To: python-list@python.org
Date: Tuesday, 28 June, 2011, 10:36 PM
On 06/29/2011 02:52 AM, Jigar Tanna wrote:
> coming across to certain views from people, it is not a good practice
> to use
> decorators with arguments (i.e. @memoize() ) and instead it is good to
> just
> use @m
yes for this case you will have to use @memoize() as all the arguments are
optional ...
Thanks,
J
--- On Tue, 28/6/11, Ian Kelly wrote:
From: Ian Kelly
Subject: Re: Using decorators with argument in Python
To: "Jigar Tanna"
Cc: python-list@python.org
Date: Tuesday, 28 June, 2011
I am new to Python and Django, was going through the concept of
decorators
where I came across a special case of using arguments with decorators
Below is the code for memoization where I was looking at the
concept...
cache = {}
def get_key(function, *args, **kw) :
key = '%s. %s: ' % (function.