homepage

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.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, daniel.urban, georg.brandl, pwerneck, rodsenra, terry.reedy
Date 2010年09月13日.15:35:11
SpamBayes Score 0.0010756139
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

AltStyle によって変換されたページ (->オリジナル) /