PyOS_InputHook enhancement proposal

Discussion in 'Python' started by umdehoon, Nov 18, 2004.

  1. umdehoon

    umdehoon Guest

    PyOS_InputHook is a pointer to a function that is called periodically (ten
    times per second) while Python is idle, for example, when waiting for a
    user command. Python C extension modules can set this pointer to a hook
    function defined in the extension module. For example, _tkinter.c makes
    use of PyOS_InputHook to get messages delivered to its widgets.

    A problem arises when two or more extension modules want to set
    PyOS_InputHook. For example, the scientific plotting package pygist needs
    PyOS_InputHook to get messages delivered to its graphics windows, and may
    therefore conflict with the Python GUI IDLE, which uses Tkinter. Chaining
    won't work, as it will fail when an extension module wants to remove its
    hook function.

    My suggestion is therefore to replace PyOS_InputHook by two functions
    PyOS_AddInputHook and PyOS_RemoveInputHook, and let Python keep track of
    which hooks are installed. This way, an extension module can add a hook
    function without having to worry about other extension modules trying
    to use the same hook.

    Any comments? Would I need to submit a PEP for this proposal?

    --Michiel, U Tokyo.
    umdehoon, Nov 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marlene

    Re: asp.net calendar enhancement

    Marlene, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    959
    Marlene
    Jun 25, 2003
  2. Fred.

    Re: asp.net calendar enhancement

    Fred., Jun 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    3,781
  3. randau
    Replies:
    30
    Views:
    1,400
    Travis Newbury
    May 20, 2005
  4. Ville M. Vainio
    Replies:
    3
    Views:
    294
    Fredrik Lundh
    Sep 13, 2008
  5. leon breedt

    RDoc enhancement proposal

    leon breedt, Jan 23, 2005, in forum: Ruby
    Replies:
    4
    Views:
    115
    Tilman Sauerbeck
    Jan 23, 2005
Loading...

Share This Page