8000 bpo-41817: use new StrEnum to ensure all members are strings (GH-22348) · python/cpython@ea0711a · GitHub
[go: up one dir, main page]

Skip to content

Commit ea0711a

Browse files
authored
bpo-41817: use new StrEnum to ensure all members are strings (GH-22348)
* use new StrEnum to ensure all members are strings
1 parent 557b9a5 commit ea0711a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Lib/tkinter/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
144144
return dict
145145

146146

147-
class EventType(str, enum.Enum):
147+
class EventType(enum.StrEnum):
148148
KeyPress = '2'
149-
Key = KeyPress,
149+
Key = KeyPress
150150
KeyRelease = '3'
151151
ButtonPress = '4'
152-
Button = ButtonPress,
152+
Button = ButtonPress
153153
ButtonRelease = '5'
154154
Motion = '6'
155155
Enter = '7'
@@ -180,10 +180,10 @@ class EventType(str, enum.Enum):
180180
Colormap = '32'
181181
ClientMessage = '33' # undocumented
182182
Mapping = '34' # undocumented
183-
VirtualEvent = '35', # undocumented
184-
Activate = '36',
185-
Deactivate = '37',
186-
MouseWheel = '38',
183+
VirtualEvent = '35' # undocumented
184+
Activate = '36'
185+
Deactivate = '37'
186+
MouseWheel = '38'
187187

188188
def __str__(self):
189189
return self.name
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix `tkinter.EventType` Enum so all members are strings, and none are tuples

0 commit comments

Comments
 (0)
0