]> granicus.if.org Git - python/commitdiff
Fix warnings about object.__init__() signature.
authorGuido van Rossum <guido@python.org>
Mon, 2 Apr 2007 23:55:37 +0000 (23:55 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 2 Apr 2007 23:55:37 +0000 (23:55 +0000)
Two (test_array and test_descr) were bug IMO; the third (copy_reg)
is a work-around which recognizes that object.__init__() doesn't do
anything.

Lib/copy_reg.py
Lib/test/test_array.py
Lib/test/test_descr.py

index f87c50ffa4b9d8e4621b01c6901bffbc89bd8905..0dd94cfc88913379934b046e0430921831c47964 100644 (file)
@@ -48,7 +48,8 @@ def _reconstructor(cls, base, state):
         obj = object.__new__(cls)
     else:
         obj = base.__new__(cls, state)
-        base.__init__(obj, state)
+        if base.__init__ != object.__init__:
+            base.__init__(obj, state)
     return obj
 
 _HEAPTYPE = 1<<9
index 597f3b24219556185f2a11bc2544e1cd30695d5b..c10ad86eea50cfa11bf555e065b092f970e7c449 100755 (executable)
@@ -728,7 +728,6 @@ class CharacterTest(StringTest):
                 return array.array.__new__(cls, 'c', s)
 
             def __init__(self, s, color='blue'):
-                array.array.__init__(self, 'c', s)
                 self.color = color
 
             def strip(self):
index 5abecf4b008e23403a48c2b003b910e6d7a5d48b..41c0bdf968f5a943d7ed58e5545bec5951b4f701 100644 (file)
@@ -2305,7 +2305,6 @@ def inherits():
         __slots__ = ['prec']
         def __init__(self, value=0.0, prec=12):
             self.prec = int(prec)
-            float.__init__(self, value)
         def __repr__(self):
             return "%.*g" % (self.prec, self)
     vereq(repr(precfloat(1.1)), "1.1")