Kaydet (Commit) 1808fbc4 authored tarafından Jeremy Hylton's avatar Jeremy Hylton

move make_eiffel_method() out of base metaclass

üst a70c3bd2
...@@ -27,6 +27,13 @@ class EiffelBaseMetaClass(type): ...@@ -27,6 +27,13 @@ class EiffelBaseMetaClass(type):
convert_methods = classmethod(convert_methods) 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 make_eiffel_method(func, pre, post):
def method(self, *args, **kwargs): def method(self, *args, **kwargs):
if pre: if pre:
...@@ -43,13 +50,6 @@ class EiffelBaseMetaClass(type): ...@@ -43,13 +50,6 @@ class EiffelBaseMetaClass(type):
make_eiffel_method = staticmethod(make_eiffel_method) 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: class EiffelMethodWrapper:
def __init__(self, inst, descr): def __init__(self, inst, descr):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment