We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
frozendict
curses.has_key
1 parent 8a531f8 commit f6b5eedCopy full SHA for f6b5eed
Lib/curses/has_key.py
@@ -7,7 +7,7 @@
7
8
# Table mapping curses keys to the terminfo capability name
9
10
-_capability_names = {
+_capability_names = frozendict({
11
_curses.KEY_A1: 'ka1',
12
_curses.KEY_A3: 'ka3',
13
_curses.KEY_B2: 'kb2',
@@ -157,7 +157,7 @@
157
_curses.KEY_SUSPEND: 'kspd',
158
_curses.KEY_UNDO: 'kund',
159
_curses.KEY_UP: 'kcuu1'
160
- }
+ })
161
162
def has_key(ch):
163
if isinstance(ch, str):
@@ -170,7 +170,7 @@ def has_key(ch):
170
171
#Check the current terminal description for that capability;
172
#if present, return true, else return false.
173
- if _curses.tigetstr( capability_name ):
+ if _curses.tigetstr(capability_name):
174
return True
175
else:
176
return False
0 commit comments