On 3/29/06, <b class="gmail_sendername">Phillip J. Eby</b> &lt;<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At 11:35 PM 3/28/2006 -0500, Fred L. Drake, Jr. wrote:<br>&gt;For Zope 3, we have decorators that work with the component architecture (I'm<br>&gt;sure Phillip is familiar with these).&nbsp;&nbsp;They're used with functions to<br>&gt;indicate that the function adapts a particular kind of object, or that it
<br>&gt;implements or provides a particular interface.&nbsp;&nbsp;We have different functions<br>&gt;that get used for this purpose in classes that are executed within the body<br>&gt;of the class.&nbsp;&nbsp;There's some merit to being able to use a single set of
<br>&gt;functions in both cases, since the use cases are the same.&nbsp;&nbsp;I'm not sure I'd<br>&gt;want to change the existing pattern, though, since it's already so widespread<br>&gt;within the Zope 3 codebase (including 3rd-party components).
<br><br>If we're using Zope 3 as an example, I personally find that:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; class Foo:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;Docstring here, blah blah blah<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; implements(IFoo)<br><br>is easier to read than:
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; @implements(IFoo)<br>&nbsp;&nbsp;&nbsp;&nbsp; class Foo:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;Docstring here, blah blah blah<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;</blockquote><div><br><br>&nbsp; Yeah, but in the first case  implements(IFoo) has to do dirty hacks involving 
sys.getframe(), so you win in once place but lose in the other one.<br>&nbsp;</div></div><br>