mirror of https://github.com/python/cpython.git
bpo-41817: use new StrEnum to ensure all members are strings (GH-22348)
* use new StrEnum to ensure all members are strings
This commit is contained in:
parent
557b9a52ed
commit
ea0711a9f9
|
@ -144,12 +144,12 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
|
||||||
return dict
|
return dict
|
||||||
|
|
||||||
|
|
||||||
class EventType(str, enum.Enum):
|
class EventType(enum.StrEnum):
|
||||||
KeyPress = '2'
|
KeyPress = '2'
|
||||||
Key = KeyPress,
|
Key = KeyPress
|
||||||
KeyRelease = '3'
|
KeyRelease = '3'
|
||||||
ButtonPress = '4'
|
ButtonPress = '4'
|
||||||
Button = ButtonPress,
|
Button = ButtonPress
|
||||||
ButtonRelease = '5'
|
ButtonRelease = '5'
|
||||||
Motion = '6'
|
Motion = '6'
|
||||||
Enter = '7'
|
Enter = '7'
|
||||||
|
@ -180,10 +180,10 @@ class EventType(str, enum.Enum):
|
||||||
Colormap = '32'
|
Colormap = '32'
|
||||||
ClientMessage = '33' # undocumented
|
ClientMessage = '33' # undocumented
|
||||||
Mapping = '34' # undocumented
|
Mapping = '34' # undocumented
|
||||||
VirtualEvent = '35', # undocumented
|
VirtualEvent = '35' # undocumented
|
||||||
Activate = '36',
|
Activate = '36'
|
||||||
Deactivate = '37',
|
Deactivate = '37'
|
||||||
MouseWheel = '38',
|
MouseWheel = '38'
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
fix `tkinter.EventType` Enum so all members are strings, and none are tuples
|
Loading…
Reference in New Issue