<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body style="word-wrap:break-word" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Courier New;color: #000000;font-size: 10pt;">
<div>Seems kind of arbitrary doesn't it?</div>
<div><br>
</div>
<div>Perhaps something about not using decorators with arguments instead? (since they're the biggest wart on the ass of Python)</div>
<div><br>
</div>
<div>-S</div>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF782832" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> openstack-bounces+sandy.walsh=rackspace.com@lists.launchpad.net [openstack-bounces+sandy.walsh=rackspace.com@lists.launchpad.net] on behalf of Lorin Hochstein
 [lorin@nimbisservices.com]<br>
<b>Sent:</b> Tuesday, January 17, 2012 12:09 PM<br>
<b>To:</b> openstack@lists.launchpad.net<br>
<b>Subject:</b> [Openstack] Proposal to limit decorator usage<br>
</font><br>
</div>
<div></div>
<div>
<div>While going through merge proposal, I ran across this one from Mark Washenberger about limiting the number of decorators to 2 in nova code: <<a href="https://review.openstack.org/2966" target="_blank">https://review.openstack.org/2966</a>></div>
<div><br>
</div>
<div>There's some good discussion on this in the proposal comments, but I thought it should hit the mailing list as well, in case folks wanted to weigh in but hadn't seen the proposal (I don't have a strong opinion pro or con here).</div>
<div><br>
</div>
<div>Here's the proposed addition for HACKING:</div>
<div><br>
</div>
<div>
<div>Decorators</div>
<div>----------</div>
<div>A function or method should not have more than two decorators applied to it</div>
<div>where it is defined.</div>
<div><br>
</div>
<div>Decorators are a powerful feature of Python that can eliminate some repetitive</div>
<div>code. However, decorator usage can be more difficult to debug or maintain than</div>
<div>alternative approaches to reduce repetition. These difficulties multiply when</div>
<div>decorators are stacked on top of each other. To ensure judicious use, we</div>
<div>therefore limit decorator depth to no more than two.</div>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div>
<div style="word-wrap:break-word"><span class="Apple-style-span" style="border-collapse:separate; color:rgb(0,0,0); font-family:Helvetica; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; font-size:medium">
<div style="word-wrap:break-word">
<div>Take care,</div>
<div><br>
</div>
<div>Lorin</div>
<div>--</div>
<div>Lorin Hochstein</div>
<div>Lead Architect - Cloud Services</div>
<div>Nimbis Services, Inc.</div>
<div><a href="https://www.nimbisservices.com/" target="_blank">www.nimbisservices.com</a></div>
<div><br>
</div>
</div>
</span><br class="Apple-interchange-newline">
</div>
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
</div>
<br>
</div>
</div>
</div>
<style type="text/css">embed[type*="application/x-shockwave-flash"],embed[src*=".swf"],object[type*="application/x-shockwave-flash"],object[codetype*="application/x-shockwave-flash"],object[src*=".swf"],object[codebase*="swflash.cab"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"],object[classid*="d27cdb6e-ae6d-11cf-96b8-444553540000"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"]{   display: none !important;}</style><style type="text/css">embed[type*="application/x-shockwave-flash"],embed[src*=".swf"],object[type*="application/x-shockwave-flash"],object[codetype*="application/x-shockwave-flash"],object[src*=".swf"],object[codebase*="swflash.cab"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"],object[classid*="d27cdb6e-ae6d-11cf-96b8-444553540000"],object[classid*="D27CDB6E-AE6D-11cf-96B8-444553540000"]{   display: none !important;}</style>
</body>
</html>