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.
This commit is contained in:
Andrew M. Kuchling 2000-06-18 18:45:50 +00:00
parent 74042d6e5d
commit e475e70128
2 changed files with 106 additions and 0 deletions

View file

@ -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