summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/MultiCall.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-08-02 20:26:41 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-08-02 20:26:41 (GMT)
commitb55d36805566c092c11b8e38792c759742cd6a1f (patch)
treefbe9279c4c088fd4c9a0ee557ff76494ffe584f7 /Lib/idlelib/MultiCall.py
parent507ea2ae1802a97fe3cd88051413219d70cb71e1 (diff)
downloadcpython-b55d36805566c092c11b8e38792c759742cd6a1f.zip
cpython-b55d36805566c092c11b8e38792c759742cd6a1f.tar.gz
cpython-b55d36805566c092c11b8e38792c759742cd6a1f.tar.bz2
Merged revisions 79558 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79558 | florent.xicluna | 2010-04-01 21:17:09 +0300 (Thu, 01 Apr 2010) | 2 lines #7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote. ........
Diffstat (limited to 'Lib/idlelib/MultiCall.py')
-rw-r--r--Lib/idlelib/MultiCall.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
index b228f57..e8a3191 100644
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -107,10 +107,9 @@ class _SimpleBinder:
# a list of the states which are a subset of it. This list is ordered by the
# number of modifiers is the state - the most specific state comes first.
_states = range(1 << len(_modifiers))
-_state_names = [reduce(lambda x, y: x + y,
- [_modifiers[i][0]+'-' for i in range(len(_modifiers))
- if (1 << i) & s],
- "")
+_state_names = [''.join(m[0]+'-'
+ for i, m in enumerate(_modifiers)
+ if (1 << i) & s)
for s in _states]
_state_subsets = map(lambda i: filter(lambda j: not (j & (~i)), _states),
_states)
@@ -119,11 +118,13 @@ for l in _state_subsets:
range(len(_modifiers)))):
nummod(b) - nummod(a))
# _state_codes gives for each state, the portable code to be passed as mc_state
-_state_codes = [reduce(lambda x, y: x | y,
- [_modifier_masks[i] for i in range(len(_modifiers))
- if (1 << i) & s],
- 0)
- for s in _states]
+_state_codes = []
+for s in _states:
+ r = 0
+ for i in range(len(_modifiers)):
+ if (1 << i) & s:
+ r |= _modifier_masks[i]
+ _state_codes.append(r)
class _ComplexBinder:
# This class binds many functions, and only unbinds them when it is deleted.