Repository navigation
Remove start_event_loop_default. Let pause() run the event loop for all backends. - #8867
Merged
Merged
Conversation
tacaswell
reviewed
Jul 13, 2017
| loop so that interactive functions, such as ginput and | ||
| waitforbuttonpress, can wait for events. | ||
| Such an event loop is used by interactive functions, such as ginput and | ||
| waitforbuttonpress, to wait for events. This should not be confused |
Member
There was a problem hiding this comment.
I do not think this is correct, the GUI event loop is not always running.
Contributor
Author
There was a problem hiding this comment.
Feel free to edit the message and force push if you'd like to.
tacaswell
approved these changes
Jul 13, 2017
Member
|
@anntzer force-pushed to this branch. |
There's no benefit to the end user to having a deprecation warning in start_event_loop (which gets called e.g. by ginput) -- it's essentially just there to let the devs know that they could implement a more efficient (GUI toolkit-dependent) version. So just provide the default implementations instead and add a note that GUI toolkits may override them. flush_events doesn't need to raise by default, it can just return nothing for non-interactive backends.
The default `start_event_loop` is not as efficient as it could be for non-interactive backends (it runs a busy loop) but if you really care you should just call time.sleep in that case. Meanwhile, this avoids the need for third-party interactive backends to register themselves into rcsetup.interactive_bk in order to be correctly pause()able.
Contributor
Author
|
Rebased. |
Contributor
Author
|
Marking this as release critical only on the basis of "it would be nice to have it for mpl_cairo (specifically not needing to register itself into interactive_bk), and it's already been approved once" -- so just hoping to catch another core dev's attention. Feel free to untag if you disagree. |
Member
|
I will leave this for @tacaswell to decide whether to backport for 2.1. |
tacaswell
pushed a commit
that referenced
this pull request
Sep 18, 2017
Remove start_event_loop_default. Let pause() run the event loop for all backends.
Member
|
Backported to v2.1.x as 35af6c0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First commit: Move start_event_loop_default to start_event_loop.
There's no benefit to the end user to having a deprecation warning in
start_event_loop (which gets called e.g. by ginput) -- it's essentially
just there to let the devs know that they could implement a more
efficient (GUI toolkit-dependent) version. So just provide the default
implementations instead and add a note that GUI toolkits may override
them.
flush_events doesn't need to raise by default, it can just return
nothing for non-interactive backends.
Second commit: Let pause always run the event loop.
The default
start_event_loopis not as efficient as it could be fornon-interactive backends (it runs a busy loop) but if you really care
you should just call time.sleep in that case.
Meanwhile, this avoids the need for third-party interactive backends to
register themselves into rcsetup.interactive_bk in order to be correctly
pause()able.