[IPython-dev] Cython based PyOS_InputHook hack

Ville M. Vainio vivainio@gmail....
Sun Feb 8 06:46:46 CST 2009


On Sun, Feb 8, 2009 at 2:07 PM, Gael Varoquaux
<gael.varoquaux@normalesup.org> wrote:

>> Inferring from your other mail, it would only seem necessary to call
>> the mainloops Yield in the input hook function.
>
> I believe this is very risky. Yield is a very fragile function. For
> instance, under Windows, calling a Yield inside a Yield is not possible.
> So if you have a GUI callback that calls a raw_input, you are likely to
> end up in this situation (recursive call of Yield) when plugging readline
> in the GUI as currently done with "ipython -wthread".

Ok, is there a better wx equivalent for gtk.mainiteration()? A simple
workaround for possible re-entrancy is just a static variable
executing_inputhook that would not run the mainloop iteration if it's
already running it.

-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-dev mailing list