<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>
okie ....i agree with your comment, if the case is simple we would
prefer not to make it complex but if required there would be nor harm in
using decorators with Arguments<br>
<br>
Thanks,<br>
J<br>
<br><br>--- On <b>Tue, 28/6/11, Lie Ryan <i><lie.1296@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Lie Ryan <lie.1296@gmail.com><br>Subject: Re: Using decorators with argument in Python<br>To: python-list@python.org<br>Date: Tuesday, 28 June, 2011, 10:36 PM<br><br><div class="plainMail">On 06/29/2011 02:52 AM, Jigar Tanna wrote:<br><br>> coming across to certain views from people, it is not a good practice<br>> to use<br>> decorators with arguments (i.e. @memoize() ) and instead it is good to<br>> just<br>> use @memoize. Can any of you guys explain me advantages and<br>> disadvantages of<br>> using each of them<br><br>Simplicity is one, using @decor() means you have at least three-level<br>nested functions, which means the code is likely to be very huge and<br>perhaps unnecessarily.<br><br>However, there is nothing wrong with using
decorators with arguments;<br>except that if you have a simpler alternative, then why use the more<br>complex ones?<br>-- <br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br></div></blockquote></td></tr></table>