New submission from Guido van Rossum: [Guido] > > I've noticed that abc.py's __instancecheck__ gets called a lot > > at times when I don't expect it. Can you research this a bit?
[Amaury] > In classobject.c, method_call() calls PyObject_IsInstance() on the > first arg when the method is unbound. > This happens a lot in io.py, each time the code calls a base class > method. [Guido] I wonder if we should get rid of this isinstance check. It is only used to be able to issue a pedantic error message. Perhaps we could even get rid of unbound methods, and just return the underlying function object instead of creating an unbound method object. This should make things a bit faster. ---------- messages: 57461 nosy: gvanrossum severity: normal status: open title: Calling base class methods is slow due to __instancecheck__ override in abc.py versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1438> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com