diff options
Diffstat (limited to 'Demo/newmetaclasses')
-rw-r--r-- | Demo/newmetaclasses/Eiffel.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Demo/newmetaclasses/Eiffel.py b/Demo/newmetaclasses/Eiffel.py index 78a8bb5..04f9915 100644 --- a/Demo/newmetaclasses/Eiffel.py +++ b/Demo/newmetaclasses/Eiffel.py @@ -9,6 +9,7 @@ class EiffelBaseMetaClass(type): return super(EiffelBaseMetaClass, meta).__new__(meta, name, bases, dict) + @classmethod def convert_methods(cls, dict): """Replace functions in dict with EiffelMethod wrappers. @@ -30,11 +31,10 @@ class EiffelBaseMetaClass(type): if pre or post: dict[k] = cls.make_eiffel_method(dict[m], pre, post) - convert_methods = classmethod(convert_methods) - class EiffelMetaClass1(EiffelBaseMetaClass): # an implementation of the "eiffel" meta class that uses nested functions + @staticmethod def make_eiffel_method(func, pre, post): def method(self, *args, **kwargs): if pre: @@ -49,8 +49,6 @@ class EiffelMetaClass1(EiffelBaseMetaClass): return method - make_eiffel_method = staticmethod(make_eiffel_method) - class EiffelMethodWrapper: def __init__(self, inst, descr): |