diff options
author | Georg Brandl <georg@python.org> | 2008-05-27 20:34:09 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-27 20:34:09 (GMT) |
commit | e81f5ef1ebf57e9df2cfefabb5c5fa67defa6d2f (patch) | |
tree | 13f435b9d8f0c352536fb92dadcb25aca673149e | |
parent | 76262356333f4bef993c61436c34ea50ccf53f28 (diff) | |
download | cpython-e81f5ef1ebf57e9df2cfefabb5c5fa67defa6d2f.zip cpython-e81f5ef1ebf57e9df2cfefabb5c5fa67defa6d2f.tar.gz cpython-e81f5ef1ebf57e9df2cfefabb5c5fa67defa6d2f.tar.bz2 |
Remove __metaclass__ remains.
-rw-r--r-- | Demo/newmetaclasses/Eiffel.py | 4 | ||||
-rw-r--r-- | Demo/newmetaclasses/Enum.py | 8 | ||||
-rw-r--r-- | Lib/test/test_descr.py | 2 | ||||
-rw-r--r-- | Parser/asdl.py | 2 | ||||
-rw-r--r-- | Tools/framer/framer/bases.py | 8 |
5 files changed, 11 insertions, 13 deletions
diff --git a/Demo/newmetaclasses/Eiffel.py b/Demo/newmetaclasses/Eiffel.py index 337ad93..15fa58a 100644 --- a/Demo/newmetaclasses/Eiffel.py +++ b/Demo/newmetaclasses/Eiffel.py @@ -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): diff --git a/Demo/newmetaclasses/Enum.py b/Demo/newmetaclasses/Enum.py index 99b6fe8..3ff8ddd 100644 --- a/Demo/newmetaclasses/Enum.py +++ b/Demo/newmetaclasses/Enum.py @@ -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(): diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ad649cb..bfbb400 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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 diff --git a/Parser/asdl.py b/Parser/asdl.py index 71d3be7..3583d84 100644 --- a/Parser/asdl.py +++ b/Parser/asdl.py @@ -10,8 +10,6 @@ browser. Changes for Python: Add support for module versions """ -#__metaclass__ = type - import os import sys import traceback diff --git a/Tools/framer/framer/bases.py b/Tools/framer/framer/bases.py index d9c99db..08aacb9 100644 --- a/Tools/framer/framer/bases.py +++ b/Tools/framer/framer/bases.py @@ -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 |