On 4/17/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:

I just noticed r53997 (from some unit tests it broke), which disallowed
things
like this:

    class X(object):
        def __repr__(self):
            return "blah"

    class Y(X, type):
        pass

    class Z:
        __metaclass__ = Y

Making X classic eliminates the TypeError, and is probably an acceptable
fix
in a lot of cases (at least as long as classic classes are available).  I
wonder if the ability to override type special methods like this was
considered
when the change was made, though?


Probably not, or at least not consciously. I think the point is that 'type'
and its subclasses are special enough that this warrants a separate 'X' that
inherits from 'type' rather than 'object'. Reduced reusability, but how
badly does this affect you in the real world, really?

--
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
_______________________________________________
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

Reply via email to