summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-07-11 21:17:26 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-07-11 21:17:26 (GMT)
commit1808fbc46daae1e8a95359716e48b3f3a927c203 (patch)
treef2997e35a701778442fd9de152302878a2cf110c /Demo
parenta70c3bd2c8d3b0e4f6b179d340216664b16983f4 (diff)
downloadcpython-1808fbc46daae1e8a95359716e48b3f3a927c203.zip
cpython-1808fbc46daae1e8a95359716e48b3f3a927c203.tar.gz
cpython-1808fbc46daae1e8a95359716e48b3f3a927c203.tar.bz2
move make_eiffel_method() out of base metaclass
Diffstat (limited to 'Demo')
-rw-r--r--Demo/newmetaclasses/Eiffel.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Demo/newmetaclasses/Eiffel.py b/Demo/newmetaclasses/Eiffel.py
index e73d0ca..3e68611 100644
--- a/Demo/newmetaclasses/Eiffel.py
+++ b/Demo/newmetaclasses/Eiffel.py
@@ -27,6 +27,13 @@ class EiffelBaseMetaClass(type):
convert_methods = classmethod(convert_methods)
+class EiffelMetaClass1(EiffelBaseMetaClass):
+ # an implementation of the "eiffel" meta class that uses nested functions
+
+ def __new__(meta, name, bases, dict):
+ meta.convert_methods(dict)
+ return super(EiffelMetaClass1, meta).__new__(meta, name, bases, dict)
+
def make_eiffel_method(func, pre, post):
def method(self, *args, **kwargs):
if pre:
@@ -43,13 +50,6 @@ class EiffelBaseMetaClass(type):
make_eiffel_method = staticmethod(make_eiffel_method)
-class EiffelMetaClass1(EiffelBaseMetaClass):
- # an implementation of the "eiffel" meta class that uses nested functions
-
- def __new__(meta, name, bases, dict):
- meta.convert_methods(dict)
- return super(EiffelMetaClass1, meta).__new__(meta, name, bases, dict)
-
class EiffelMethodWrapper:
def __init__(self, inst, descr):