]> granicus.if.org Git - python/commitdiff
Patch #403514: precompute _subst_format_str to avoid a call to
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Aug 2001 16:57:33 +0000 (16:57 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Aug 2001 16:57:33 +0000 (16:57 +0000)
string.join() on each invocation of _bind.

Lib/lib-tk/Tkinter.py

index da436c1999f9404d87b0fcebb931077c6a756bd9..c7cd2bf831f67a4e436b6d7bf6a830cea791f6f1 100644 (file)
@@ -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