<div dir="ltr"><div class="gmail_quote">On Thu, Mar 31, 2011 at 10:01 AM, phelix <span dir="ltr"></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>
&gt;&gt; I am trying to write an extension to add autocompletion for &quot;self&quot;.<br>
&gt;Have you tried adding this functionality to the existing AutoComplete<br>
&gt;extension? That could save you a lot of work and would be the best way to<br>
&gt;do it.<br>
</div>I took a good look at it and also at CodeContext and learned a lot from it.<br>
But it was easier to put it into its own extension and seemed cleaner to me.<br>
Of course the completions show up in AutoComplete. What it does is that it<br>
simply points a global Reference &quot;self&quot; to the classname(s) it finds in the<br>
editor above the cursor.<br><div class="im"></div></blockquote><div class="im"><br>For your own good and for the good of IDLE, I urge you to try implementing this by improving AutoComplete. Your approach (as I understand it) both requires first fixing a delicate bug regarding IDLE&#39;s event handling and messes around with the Shell&#39;s namespace. I don&#39;t think you will manage to get such a patch accepted.<br>

<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
&gt;The best tip I can give you is to run IDLE from the command line (on<br>
&gt;Windows, C:\Python32\python.exe C:\Python32\Lib\idlelib\idle.py). Then you<br>
&gt;can see output and exceptions printed to the command console. You could also<br>
&gt;print your own debugging info using &quot;print&quot; instead of using that s_print<br>
&gt;function, and it won&#39;t show up in IDLE&#39;s shell, just in the command console.<br></blockquote>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I figured this out by coincidence just after I had posted this question.<br>
Though it seems very obvious to me know this is a very good hint and should<br>
by all means be included in the extend.txt file or on some website about<br>
IDLE Development.<br></blockquote><div><br>Good point.<br><br>If you submit a patch which updates extend.txt appropriately, I&#39;ll review it.<br><br>- Tal<br></div></div></div>