On 3/29/06, <b class="gmail_sendername">Phillip J. Eby</b> <<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>> 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>>For Zope 3, we have decorators that work with the component architecture (I'm<br>>sure Phillip is familiar with these). They're used with functions to<br>>indicate that the function adapts a particular kind of object, or that it
<br>>implements or provides a particular interface. We have different functions<br>>that get used for this purpose in classes that are executed within the body<br>>of the class. There's some merit to being able to use a single set of
<br>>functions in both cases, since the use cases are the same. I'm not sure I'd<br>>want to change the existing pattern, though, since it's already so widespread<br>>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> class Foo:<br> """Docstring here, blah blah blah<br> """<br> implements(IFoo)<br><br>is easier to read than:
<br><br> @implements(IFoo)<br> class Foo:<br> """Docstring here, blah blah blah<br> """</blockquote><div><br><br> 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> </div></div><br>