diff options
author | Fred Drake <fdrake@acm.org> | 1997-05-03 04:16:23 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1997-05-03 04:16:23 (GMT) |
commit | 526749b6782cfb56f995b8a299a39195b23b77bf (patch) | |
tree | 6bf4ae71f759ab06391bc56f3086273a34bbed6a | |
parent | 84bf42531c482e760a8762aa5d6a10de73937a9b (diff) | |
download | cpython-526749b6782cfb56f995b8a299a39195b23b77bf.zip cpython-526749b6782cfb56f995b8a299a39195b23b77bf.tar.gz cpython-526749b6782cfb56f995b8a299a39195b23b77bf.tar.bz2 |
Misc.__init__(): Removed method, replaced with class attribute (which
was all that the method set anyway). Removed calls to the
constructor. This reduces the number of Python function calls
per widget construction by one, for every widget construction.
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 5 | ||||
-rwxr-xr-x | Lib/tkinter/Tkinter.py | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 8d6cf7d..740dc89 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -119,8 +119,7 @@ def getboolean(s): return _default_root.tk.getboolean(s) class Misc: - def __init__(self): - self._tclCommands = None + _tclCommands = None def destroy(self): if self._tclCommands is not None: for name in self._tclCommands: @@ -661,7 +660,6 @@ class Wm: class Tk(Misc, Wm): _w = '.' def __init__(self, screenName=None, baseName=None, className='Tk'): - Misc.__init__(self) global _default_root self.master = None self.children = {} @@ -907,7 +905,6 @@ class Widget(Misc, Pack, Place, Grid): self.master.children[self._name].destroy() self.master.children[self._name] = self def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): - Misc.__init__(self) if kw: cnf = _cnfmerge((cnf, kw)) self.widgetName = widgetName diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index 8d6cf7d..740dc89 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -119,8 +119,7 @@ def getboolean(s): return _default_root.tk.getboolean(s) class Misc: - def __init__(self): - self._tclCommands = None + _tclCommands = None def destroy(self): if self._tclCommands is not None: for name in self._tclCommands: @@ -661,7 +660,6 @@ class Wm: class Tk(Misc, Wm): _w = '.' def __init__(self, screenName=None, baseName=None, className='Tk'): - Misc.__init__(self) global _default_root self.master = None self.children = {} @@ -907,7 +905,6 @@ class Widget(Misc, Pack, Place, Grid): self.master.children[self._name].destroy() self.master.children[self._name] = self def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): - Misc.__init__(self) if kw: cnf = _cnfmerge((cnf, kw)) self.widgetName = widgetName |