From 24989727b97368506c85bb23a1adfdf698f9ed7e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 27 May 2002 13:35:05 +0000 Subject: Use self.__class__ to instantiate a TreeNode item recursively, to allow subclassing. --- Tools/idle/TreeWidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/idle/TreeWidget.py b/Tools/idle/TreeWidget.py index be80a63..37bc58f 100644 --- a/Tools/idle/TreeWidget.py +++ b/Tools/idle/TreeWidget.py @@ -187,7 +187,7 @@ class TreeNode: # _IsExpandable() was mistaken; that's allowed return y+17 for item in sublist: - child = TreeNode(self.canvas, self, item) + child = self.__class__(self.canvas, self, item) self.children.append(child) cx = x+20 cy = y+17 -- cgit v0.12