G
Giovanni Bajo
Hello,
I noticed that bultin types like list, set, dict, tuple don't seem to adhere to
the convention of using super() in constructor to correctly allow
diamond-shaped inheritance (through MRO). For instance:
.... def __init__(self):
.... print "A.__init__"
.... super(A, self).__init__()
........ def __init__(self):
.... print "B.__init__"
.... super(B, self).__init__()
....
.... print "C.__init__"
.... super(C, self).__init__()
....C.__init__
[]
It seems weird to me that I have to swap the order of bases to get the expected
behaviour. Is there a reason for this, or is it simply a bug that should be
fixed?
I noticed that bultin types like list, set, dict, tuple don't seem to adhere to
the convention of using super() in constructor to correctly allow
diamond-shaped inheritance (through MRO). For instance:
.... def __init__(self):
.... print "A.__init__"
.... super(A, self).__init__()
........ def __init__(self):
.... print "B.__init__"
.... super(B, self).__init__()
....
.... def __init__(self):B.__init__
A.__init__
[]
.... print "C.__init__"
.... super(C, self).__init__()
....C.__init__
[]
It seems weird to me that I have to swap the order of bases to get the expected
behaviour. Is there a reason for this, or is it simply a bug that should be
fixed?