[pybank] Synthesize constructor as __init__ instead of __new__



commit 495bb67cc295d56adee6f41caa423037701895ab
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Fri May 8 18:02:36 2009 +0200

    Synthesize constructor as __init__ instead of __new__
---
 bank/btypes.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bank/btypes.py b/bank/btypes.py
index 8ee7fbb..66f69c0 100644
--- a/bank/btypes.py
+++ b/bank/btypes.py
@@ -213,8 +213,8 @@ def setupConstructors(className, cls, constructors):
 
     if winner != None:
         func = Method(winner, className, call_type=Method.CLASS_METHOD)
-        cls.__new__ = func
-        func.__name__ = "__new__"
+        cls.__init__ = func
+        func.__name__ = "__init__"
         constructors.remove(winner)
 
     for constructor in constructors:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]