Nick Coghlan <[EMAIL PROTECTED]> writes: > Josiah Carlson wrote: >> You can get the same semantics with... >> >> class NAME(_(TYPE), ARGS): >> BLOCK >> >> And a suitably defined _. Remember, not every X line function should be >> made a builtin or syntax. > > And this would be an extremely fragile hack that is entirely > dependent on the murky rules regarding how Python chooses the > metaclass for the newly created class.
Uh, not really. In the presence of base classes it's always "the type of the first base". The reason it might not seem this simple is that most metaclasses end up calling type.__new__ at some point and this function does more complicated things (such as checking for metaclass conflict and deferring to the most specific metaclass). Not sure what the context is here, but I have to butt in when I see people complicating things which aren't actually that complicated... Cheers, mwh -- There's an aura of unholy black magic about CLISP. It works, but I have no idea how it does it. I suspect there's a goat involved somewhere. -- Johann Hibschman, comp.lang.scheme _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com