Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f01f6b8

Browse filesBrowse files
authored
Merge pull request #13942 from anntzer/enumcursors
Make Cursors an (Int)Enum.
2 parents bbd10ba + f2470a9 commit f01f6b8
Copy full SHA for f01f6b8

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed

‎lib/matplotlib/backend_tools.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_tools.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
`matplotlib.backend_managers.ToolManager`
1212
"""
1313

14+
from enum import IntEnum
15+
import logging
1416
import re
1517
import time
16-
import logging
1718
from types import SimpleNamespace
1819
from weakref import WeakKeyDictionary
1920

@@ -26,10 +27,10 @@
2627
_log = logging.getLogger(__name__)
2728

2829

29-
class Cursors(object):
30-
"""Simple namespace for cursor reference"""
30+
class Cursors(IntEnum): # Must subclass int for the macOS backend.
31+
"""Backend-independent cursor types."""
3132
HAND, POINTER, SELECT_REGION, MOVE, WAIT = range(5)
32-
cursors = Cursors()
33+
cursors = Cursors # Backcompat.
3334

3435
# Views positions tool
3536
_views_positions = 'viewpos'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.