A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-April/072643.html below:

[Python-Dev] new metaclass error condition checks

[Python-Dev] new metaclass error condition checks [Python-Dev] new metaclass error condition checksJean-Paul Calderone exarkun at divmod.com
Tue Apr 17 00:53:20 CEST 2007
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?

Jean-Paul
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4