Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b64fe2

Browse files
committed
DOC: correct note about PyOS_InputHook
closes #32314
1 parent 284213d commit 4b64fe2

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

galleries/users_explain/figure/interactive_guide.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,18 @@ The hook functions typically exhaust all pending events on the GUI
405405
event queue, run the main loop for a short fixed amount of time, or
406406
run the event loop until a key is pressed on stdin.
407407

408-
Matplotlib does not currently do any management of :c:data:`PyOS_InputHook` due
409-
to the wide range of ways that Matplotlib is used. This management is left to
410-
downstream libraries -- either user code or the shell. Interactive figures,
411-
even with Matplotlib in "interactive mode", may not work in the vanilla python
412-
repl if an appropriate :c:data:`PyOS_InputHook` is not registered.
413-
414-
Input hooks, and helpers to install them, are usually included with
415-
the python bindings for GUI toolkits and may be registered on import.
408+
Interactive figures, even with Matplotlib in "interactive mode", may not work
409+
in REPL if an appropriate :c:data:`PyOS_InputHook` is not registered. This
410+
management is left to upstream libraries or downstream code -- either explicit
411+
user code or shell initialization -- in all backends but the native Mac
412+
backend. Input hooks, and helpers to install them, are usually included with
413+
the Python bindings for GUI toolkits and may be registered on import. For the
414+
Mac backend Matplotlib owns the code wrapping the native GUI toolkit and we
415+
register :c:data:`PyOS_InputHook` on application initialization.
416+
416417
IPython also ships input hook functions for all of the GUI frameworks
417-
Matplotlib supports which can be installed via ``%matplotlib``. This
418-
is the recommended method of integrating Matplotlib and a prompt.
418+
Matplotlib supports which can be installed via ``%matplotlib``. This is the
419+
recommended method of integrating Matplotlib and a prompt.
419420

420421

421422
IPython / prompt_toolkit

0 commit comments

Comments
 (0)