<br><br><div class="gmail_quote">On Fri, Apr 3, 2009 at 1:55 PM, Gary Poster <span dir="ltr">&lt;<a href="mailto:gary.poster@gmail.com">gary.poster@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
How would that be a win for you (or anybody else) over just putting the constant in the interfaces module?<br>
</blockquote><div><br>Standard practice seems to favor putting several interfaces in a single &quot;interfaces&quot; module, so just putting the constants in the module doesn&#39;t make it explicit that these constants go with a particular interface.  Putting them on the interface itself makes the relationship plain.<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
If it is in the interface, that implies we need to &quot;implement&quot; it someplace--the constant will be defined in the interface and in the implementation?  Or we would offer automation to copy the values over from the interface to objects that implement the interface?<div class="im">
</div></blockquote><div><br> </div><div>Thanks for bringing that up.  I hadn&#39;t considered that.  In languages with built-in interface support, classes generally inherent constants from the interface, so automatically copying the values over would seem to make sense.  Although it&#39;s also considered best practice in those languages to refer to the constants by their interface anyway, so one could argue that such a step could be omitted.  Zope&#39;s implementation of interfaces is unique among implementations I know about, in allowing programmers to mark live objects with an interface, which would introduce an interesting edge case with regards to copying constants over.  I&#39;d say if the implementation gets too polluted with edge cases, it&#39;s probably not worth it.  <br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Using descriptors, the results could be both static and immutable.<br>
</blockquote>
<br></div>
Mostly static and immutable, anyway. :-)  In Python, there&#39;s almost always a way around absolutes like that unless you are working with something in which the constraint has been coded in C.<br>
</blockquote><div><br>Right, but since we have descriptors, why not use them?  Maybe I should have used the Colbertian &quot;immutablish&quot;.<br> <br></div>I don&#39;t have my heart set on this.  I found a use case today and was just thinking about ways to satisfy it.<br>
<br>Thanks,<br>Chris<br><br></div><br>