summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-08-09 16:57:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-08-09 16:57:33 (GMT)
commitc8718c13e86aff14fbb65d32ab91908c445c98c6 (patch)
tree847d9feb55f2ceffcc5f7eaf9210665c50679ac8 /Lib
parente358b423c28316cc18928d9df9f82d4c8678b6d3 (diff)
downloadcpython-c8718c13e86aff14fbb65d32ab91908c445c98c6.zip
cpython-c8718c13e86aff14fbb65d32ab91908c445c98c6.tar.gz
cpython-c8718c13e86aff14fbb65d32ab91908c445c98c6.tar.bz2
Patch #403514: precompute _subst_format_str to avoid a call to
string.join() on each invocation of _bind.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-tk/Tkinter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index da436c1..c7cd2bf 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -848,8 +848,7 @@ class Misc:
cmd = ('%sif {"[%s %s]" == "break"} break\n'
%
(add and '+' or '',
- funcid,
- " ".join(self._subst_format)))
+ funcid, self._subst_format_str))
self.tk.call(what + (sequence, cmd))
return funcid
elif sequence:
@@ -1012,6 +1011,7 @@ class Misc:
_subst_format = ('%#', '%b', '%f', '%h', '%k',
'%s', '%t', '%w', '%x', '%y',
'%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D')
+ _subst_format_str = " ".join(_subst_format)
def _substitute(self, *args):
"""Internal function."""
if len(args) != len(self._subst_format): return args