Author mwh
Recipients
Date 2002-11-09.14:59:25
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
As per discussion on python-dev, this patch makes the
following attributes of type objects writable from Python:

 - __name__
 - __bases__
 - __mro__

It also relaxes the restriction on not returning
__module__ when that's been set to a non-string. This
(tiny) part is a 2.2.3 candidate IMHO.

It lets the following work:

class C(object):
    pass

class D(C):
    pass

class E(object):
    def meth(self):
        print 1

d = D()
D.__bases__ = (C, E)
d.meth()

but that's the extent of my testing so far.  Needs a
test and docs -- if the current behaviour is documented
anywhere.

Currently, if an assignment to __bases__ would change
__base__, it complains (was easiest).

Assigned to Guido so he sees it, but anyone else is
encouraged to review it!
History
Date User Action Args
2007-08-23 15:18:03adminlinkissue635933 messages
2007-08-23 15:18:03admincreate