Létező wrote:
> I use Python 2.4.4. Please read the code below:
>
> ---
> from new import classobj
>
> def mymeta(name,bases,clsdict):
> print 'meta: %s'%name
> return classobj(name,bases,clsdict)
>
> class A(object):
> __metacl
Létez? wrote:
> I use Python 2.4.4. Please read the code below:
>
> ---
> from new import classobj
>
> def mymeta(name,bases,clsdict):
> print 'meta: %s'%name
> return classobj(name,bases,clsdict)
mymeta is not a class.
> class A
I use Python 2.4.4. Please read the code below:
---
from new import classobj
def mymeta(name,bases,clsdict):
print 'meta: %s'%name
return classobj(name,bases,clsdict)
class A(object):
__metaclass__=mymeta
class B(A):
pass
I use Python 2.4.4. Please read the code below:
---
from new import classobj
def mymeta(name,bases,clsdict):
print 'meta: %s'%name
return classobj(name,bases,clsdict)
class A(object):
__metaclass__=mymeta
class B(A):
pass