At 07:46 AM 8/2/2007 -0700, Guido van Rossum wrote: >On 8/1/07, Talin <[EMAIL PROTECTED]> wrote: > > I think that in order to 'mix' metaclasses, each metaclass needs to get > > a crack at the members as they are defined. The 'dict' object really > > isn't important - what's important is to be able to overload the > > creation of a class member. > > > > I can think of a couple ways to accomplish this. > > > > 1) The first, and most brute force idea is to pass to a metaclass's > > __prepare__ statement an extra parameter containing the result of the > > previous metaclass's __prepare__ method. This would allow the > > __prepare__ statement to *wrap* the earlier metaclass's dict, > > intercepting the insertion operations or passing them through as needed. > >I'm confused. The only way to mix metaclasses is by explicitly >multiply inheriting them. So the normal "super" machinery should work, >shouldn't it?
Yes. As I said in the email Talin was replying to, it's sufficient to document the fact that a metaclass should call its super()'s __prepare__ and delegate operations to it; the additional stuff Talin is suggesting is unnecessary. > (Except for 'type' not defining __prepare__(), but that >can be fixed.) Yep. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com