diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-06-18 18:45:50 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-06-18 18:45:50 (GMT) |
commit | e475e70128e5e12392faa10f6556460c308efc0a (patch) | |
tree | d6b30e75b24f410540f9087b571d338f3b885064 /Lib/lib-tk | |
parent | 74042d6e5d44cc9d332c28414a1e04eadd204248 (diff) | |
download | cpython-e475e70128e5e12392faa10f6556460c308efc0a.zip cpython-e475e70128e5e12392faa10f6556460c308efc0a.tar.gz cpython-e475e70128e5e12392faa10f6556460c308efc0a.tar.bz2 |
Patch from /F:
this patch adds a fast _flatten function to the _tkinter
module, and imports it from Tkinter.py (if available).
this speeds up canvas operations like create_line and
create_polygon. for example, a create_line with 5000
vertices runs about 50 times faster with this patch in
place.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index f8b4bd5..b4c9ccc 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -39,6 +39,9 @@ def _flatten(tuple): res = res + (item,) return res +try: _flatten = _tkinter._flatten +except AttributeError: pass + def _cnfmerge(cnfs): if type(cnfs) is DictionaryType: return cnfs @@ -55,6 +58,9 @@ def _cnfmerge(cnfs): cnf[k] = v return cnf +try: _cnfmerge = _tkinter._cnfmerge +except AttributeError: pass + class Event: pass |