Kaydet (Commit) ab8802a4 authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix warnings about object.__init__() signature.

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.
üst 01a807db
...@@ -48,7 +48,8 @@ def _reconstructor(cls, base, state): ...@@ -48,7 +48,8 @@ def _reconstructor(cls, base, state):
obj = object.__new__(cls) obj = object.__new__(cls)
else: else:
obj = base.__new__(cls, state) obj = base.__new__(cls, state)
base.__init__(obj, state) if base.__init__ != object.__init__:
base.__init__(obj, state)
return obj return obj
_HEAPTYPE = 1<<9 _HEAPTYPE = 1<<9
......
...@@ -728,7 +728,6 @@ class CharacterTest(StringTest): ...@@ -728,7 +728,6 @@ class CharacterTest(StringTest):
return array.array.__new__(cls, 'c', s) return array.array.__new__(cls, 'c', s)
def __init__(self, s, color='blue'): def __init__(self, s, color='blue'):
array.array.__init__(self, 'c', s)
self.color = color self.color = color
def strip(self): def strip(self):
......
...@@ -2305,7 +2305,6 @@ def inherits(): ...@@ -2305,7 +2305,6 @@ def inherits():
__slots__ = ['prec'] __slots__ = ['prec']
def __init__(self, value=0.0, prec=12): def __init__(self, value=0.0, prec=12):
self.prec = int(prec) self.prec = int(prec)
float.__init__(self, value)
def __repr__(self): def __repr__(self):
return "%.*g" % (self.prec, self) return "%.*g" % (self.prec, self)
vereq(repr(precfloat(1.1)), "1.1") vereq(repr(precfloat(1.1)), "1.1")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment