Question about accessing class-attributes.

Michael Hudson mwh at python.net
Fri Apr 25 08:49:02 EDT 2003


mis6 at pitt.edu (Michele Simionato) writes:

> The meta-type conflict is rather annoying, indeed. According to the
> metaclass book, the language should generate the correct metaclass
> that solves the conflict automatically, without burden for the
> programmer. Python is not that magic (yet) therefore you have to
> solve the conflict yourself.

I guess a potential problem is that if you do

class C(object):
    __metaclass__ = A

class D(object):
    __metaclass__ = B

class E(C, D):
    pass

class F(C, D):
    pass

you'd like both E and F to have the *same* (rather than merely
equivalent) metaclasses.  This would seem to be tricky to arrange.

Cheers,
M.

-- 
  Problem: Printer is missing.
  Solution: Printer has been stolen.  Buy new one.
                                      -- Internet Oracularity #1306-03




More information about the Python-list mailing list