Dont' know where are you going with that but if what you need is
cancelling some attributes when inheriting then probably this is a
cleaner approach:
class Meta(type):
def __init__(cls, name, bases, dic):
def attributeError(*_):
raise AttributeError
for base in bases:
kyo guan wrote:
> How to Adding Functionality to a Class by metaclass(not by inherit)
>
[snip]
>
> class MetaFoo(type):
> def __init__(cls, name, bases, dic):
> super(MetaFoo, cls).__init__(name, bases, dic)
>
>
How to Adding Functionality to a Class by metaclass(not by inherit)
#example:
import inspect
class Foo(object):
def f(self):
pass
def g(self):
pass
class MetaFoo(type):
def __init__(cls, name, bases, dic
How to Adding Functionality to a Class by metaclass(not by inherit)
#example:
import inspect
class Foo(object):
def f(self):
pass
def g(self):
pass
class MetaFoo(type):
def __init__(cls, name, bases, dic