On Thu, Feb 14, 2008 at 2:36 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Eric Smith wrote: > > Are you saying I should call _PyType_Lookup first? > > No, I think he's saying that you don't need to call > _PyType_Lookup at all, because anything that it could > find will also be found by PyObject_GetAttr. > > So just call PyObject_GetAttr and it should Just Work.
In case you missed the final result, that turned out to be wrong too: format(object, "") dies when you do it that way. We debugged this very same issue about a year ago, and that's where the _PyType_Lookup call was found to be the solution. GetAttr should only be used for classic class instances (PyInstance_Check()). -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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