<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>
>> I am trying to write an extension to add autocompletion for "self".<br>
>Have you tried adding this functionality to the existing AutoComplete<br>
>extension? That could save you a lot of work and would be the best way to<br>
>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 "self" 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's event handling and messes around with the Shell's namespace. I don'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">
>The best tip I can give you is to run IDLE from the command line (on<br>
>Windows, C:\Python32\python.exe C:\Python32\Lib\idlelib\idle.py). Then you<br>
>can see output and exceptions printed to the command console. You could also<br>
>print your own debugging info using "print" instead of using that s_print<br>
>function, and it won't show up in IDLE'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'll review it.<br><br>- Tal<br></div></div></div>