Paul's right. I agree it's confusing that object and type are both defined in the same file (though there's probably a good reason, given that type is derived from object and object is an instance of type :-). To add methods to object, add them to object_methods in that file. I've tested this.
On 8/16/07, Paul Moore <[EMAIL PROTECTED]> wrote: > On 16/08/07, Eric Smith <[EMAIL PROTECTED]> wrote: > > Christian Heimes wrote: > > > look at Objects/typeobject.c and grep for PyMethodDef object_methods[] > > > > I should have mentioned that's among the things I've already tried. > [...] > > You don't see the methods in typeobject.c (__mro__, etc). > > __mro__ is in type_members (at the top of the file). You want > object_methods (lower down). All it currently defines is __reduce__ > and __reduce_ex__ (which are in dir(object()). > > I've not tested (or ever used) this, so I could be wrong, of course. > Paul. > _______________________________________________ > Python-3000 mailing list > [email protected] > http://mail.python.org/mailman/listinfo/python-3000 > Unsubscribe: > http://mail.python.org/mailman/options/python-3000/guido%40python.org > -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
