Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, daniel.urban, georg.brandl, pwerneck, rodsenra, terry.reedy
Date 2010-09-13.15:35:11
SpamBayes Score 0.00107561
Marked as misclassified No
Message-id <1284392112.56.0.815651674404.issue1294232@psf.upfronthosting.co.za>
In-reply-to
Content
What also worries me is the difference between the "class" statement and the type() function.

class M_A(type):
    def __new__(mcls, name, bases, ns):
       print('M_A.__new__', mcls, name, bases)
       return super().__new__(mcls, name, bases, ns)

class M_B(M_A):
    def __new__(mcls, name, bases, ns):
       print('M_B.__new__', mcls, name, bases)
       return super().__new__(mcls, name, bases, ns)

class A(metaclass=M_A): pass
class B(metaclass=M_B): pass

class C(A, B): pass
D = type('D', (A, B), {})

The construction of C and D won't print the same messages.
History
Date User Action Args
2010-09-13 15:35:12amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, georg.brandl, terry.reedy, rodsenra, pwerneck, daniel.urban
2010-09-13 15:35:12amaury.forgeotdarcsetmessageid: <1284392112.56.0.815651674404.issue1294232@psf.upfronthosting.co.za>
2010-09-13 15:35:11amaury.forgeotdarclinkissue1294232 messages
2010-09-13 15:35:11amaury.forgeotdarccreate