mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
Remove __metaclass__ remains.
This commit is contained in:
parent
7626235633
commit
e81f5ef1eb
@ -85,8 +85,8 @@ class EiffelMetaClass2(EiffelBaseMetaClass):
|
||||
make_eiffel_method = EiffelDescriptor
|
||||
|
||||
def _test(metaclass):
|
||||
class Eiffel:
|
||||
__metaclass__ = metaclass
|
||||
class Eiffel(metaclass=metaclass):
|
||||
pass
|
||||
|
||||
class Test(Eiffel):
|
||||
|
||||
|
@ -82,11 +82,11 @@ class EnumInstance(int):
|
||||
def __str__(self):
|
||||
return "%s.%s" % (self.__classname, self.__enumname)
|
||||
|
||||
class Enum:
|
||||
__metaclass__ = EnumMetaclass
|
||||
class Enum(metaclass=EnumMetaclass):
|
||||
pass
|
||||
|
||||
class FullEnum:
|
||||
__metaclass__ = FullEnumMetaclass
|
||||
class FullEnum(metaclass=FullEnumMetaclass):
|
||||
pass
|
||||
|
||||
def _test():
|
||||
|
||||
|
@ -440,7 +440,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
|
||||
self.assertEqual(a[100:200], (100,200))
|
||||
|
||||
def test_metaclass(self):
|
||||
# Testing __metaclass__...
|
||||
# Testing metaclasses...
|
||||
class C(metaclass=type):
|
||||
def __init__(self):
|
||||
self.__state = 0
|
||||
|
@ -10,8 +10,6 @@ browser.
|
||||
Changes for Python: Add support for module versions
|
||||
"""
|
||||
|
||||
#__metaclass__ = type
|
||||
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
|
@ -96,8 +96,8 @@ class ModuleMetaclass(BaseMetaclass):
|
||||
|
||||
p("}")
|
||||
|
||||
class Module:
|
||||
__metaclass__ = ModuleMetaclass
|
||||
class Module(metaclass=ModuleMetaclass):
|
||||
pass
|
||||
|
||||
class TypeMetaclass(BaseMetaclass):
|
||||
|
||||
@ -211,5 +211,5 @@ class TypeMetaclass(BaseMetaclass):
|
||||
p(template.type_init_type)
|
||||
p(template.module_add_type)
|
||||
|
||||
class Type:
|
||||
__metaclass__ = TypeMetaclass
|
||||
class Type(metaclass=TypeMetaclass):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user