diff options
author | Guido van Rossum <guido@python.org> | 2005-01-16 00:16:11 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2005-01-16 00:16:11 (GMT) |
commit | 75b64e65f10b04e3a2bdac6d0e3db289bbd796cb (patch) | |
tree | 4351c7f8e1164c02510c187ecac7d8b4a253402d /Demo/newmetaclasses | |
parent | 9ba3684ecceff35137a5bcacbc611d36855e7666 (diff) | |
download | cpython-75b64e65f10b04e3a2bdac6d0e3db289bbd796cb.zip cpython-75b64e65f10b04e3a2bdac6d0e3db289bbd796cb.tar.gz cpython-75b64e65f10b04e3a2bdac6d0e3db289bbd796cb.tar.bz2 |
Use decorators.
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): |