This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 amaury.forgeotdarc
收信人 amaury.forgeotdarc, daniel.urban, georg.brandl, pwerneck, rodsenra, terry.reedy
日期 2010-09-13.15:35:11
SpamBayes Score 0.0010756139
Marked as misclassified
Message-id <1284392112.56.0.815651674404.issue1294232@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2010-09-13 15:35:12amaury.forgeotdarc修改recipients: + amaury.forgeotdarc, georg.brandl, terry.reedy, rodsenra, pwerneck, daniel.urban
2010-09-13 15:35:12amaury.forgeotdarc修改messageid: <1284392112.56.0.815651674404.issue1294232@psf.upfronthosting.co.za>
2010-09-13 15:35:11amaury.forgeotdarc链接issue1294232 messages
2010-09-13 15:35:11amaury.forgeotdarc创建