8000 bpo-41817: use new StrEnum to ensure all members are strings by ethanfurman · Pull Request #22348 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41817: use new StrEnum to ensure all members are strings #22348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Lib/tkinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
return dict


class EventType(str, enum.Enum):
class EventType(enum.StrEnum):
KeyPress = '2'
Key = KeyPress,
Key = KeyPress
KeyRelease = '3'
ButtonPress = '4'
Button = ButtonPress,
Button = ButtonPress
ButtonRelease = '5'
Motion = '6'
Enter = '7'
Expand Down Expand Up @@ -180,10 +180,10 @@ class EventType(str, enum.Enum):
Colormap = '32'
ClientMessage = '33' # undocumented
Mapping = '34' # undocumented
VirtualEvent = '35', # undocumented
Activate = '36',
Deactivate = '37',
MouseWheel = '38',
VirtualEvent = '35' # undocumented
Activate = '36'
Deactivate = '37'
MouseWheel = '38'

def __str__(self):
7C1E return self.name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix `tkinter.EventType` Enum so all members are strings, and none are tuples
0