<br><div class="gmail_quote">On Thu, Jul 28, 2011 at 10:41 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
</div>Nice, but it still hides the definitions from static analyzers.<br>
<br>
It seems I am almost unique in my insistence that Python's dynamic<br>
features be used very sparingly. :-)</blockquote><div><br></div><div>Having worked recently on a project that made extensive use of dynamics, I am on your side. In that project, I found it completely impossible to trace a path between any two points in the program short of stepping through it with a debugger. There are classes and functions that are never explicitly referenced anywhere that are found via reflection and then instantiated and called and it is a nightmare.</div>

<div><br></div><div>On the other hand, I love dynamic features for writing tests.</div><div class="gmail_quote"><br></div>On Thu, Jul 28, 2011 at 10:12 AM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org">barry@python.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<div class="im"><br></div>Ezio had a very nice suggestion, which I've implemented in my experimental<br>branch, e.g.:<br><br>   >>> foo = sys.modules['foo']<br>   >>> Colors.inject(foo)<br><br>

.inject() takes anything that implements the setattr() protocol.  So that you<br>could then do:<br><br>   >>> import foo<br>   >>> foo.red<br>   Colors.red</blockquote><div><br></div><div>So in this example, how would I figure out where foo.red is set? I can't do it by looking at the source unless I know about Colors.inject.</div>

<div><br></div><div>And what happens if my Weather class has a value Snow and then someone adds that to the Colors enum and clobbers Weather.Snow. I didn't change my class but suddenly I can't make it Snow.</div>
<div>
 </div><font face="arial, helvetica, sans-serif">--- Bruce</font><div><font face="arial, helvetica, sans-serif">Follow me: <a href="http://www.twitter.com/Vroo" target="_blank">http://www.twitter.com/Vroo</a> <a href="http://www.vroospeak.com/" target="_blank">http://www.vroospeak.com</a></font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><br><div> </div></div>