08/09/10 12:57:02
#新らしい形式クラス
class X(object):
pass
class Y():
__metaclass__ = type
Z = type("Z",(),{})
#古い形式クラス
class H():
pass
print type(X) #<type 'type'>
print type(Y) #<type 'type'>
print type(Z) #<type 'type'>
print type(H) #<type 'classobj'>
>>46のメタクラス決定順の通り、クラスオブジェクトHは旧式のメタクラスが使用されている。