[Python-checkins]
python/dist/src/Demo/newmetaclasses Eiffel.py, 1.6, 1.7
gvanrossum at users.sourceforge.net
gvanrossum at users.sourceforge.net
Sun Jan 16 01:12:39 CET 2005
Update of /cvsroot/python/python/dist/src/Demo/newmetaclasses
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26476
Modified Files:
Eiffel.py
Log Message:
Use decorators.
Index: Eiffel.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/newmetaclasses/Eiffel.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Eiffel.py 18 Jul 2004 05:56:07 -0000 1.6
+++ Eiffel.py 16 Jan 2005 00:12:35 -0000 1.7
@@ -9,6 +9,7 @@
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 @@
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 @@
return method
- make_eiffel_method = staticmethod(make_eiffel_method)
-
class EiffelMethodWrapper:
def __init__(self, inst, descr):
More information about the Python-checkins
mailing list