Guido van Rossum <gu...@python.org> added the comment: On Wed, Nov 2, 2011 at 9:31 AM, Éric Araujo <rep...@bugs.python.org> wrote: > > Éric Araujo <mer...@netwok.org> added the comment: > > I’ve updated my patch to handle modules and functions too, but there is a > decision to make. The functions of built-in modules are implemented by > methodobject.c, not functionobject.c (that’s for Python functions), so if we > want str(sys.exc_info) to be equal to 'exc_info', then we’ll have > str(dict.update) == 'update'. Is this okay?
Hm, that doesn't seem right. Currently, str(sys.exc_info) says <built-in function exc_info> but str(dict.update) is <built-in function exc_info>. So the latter definitely knows that it is an unbound method! And {}.update is <built-in method update of dict object at 0x10040c050> so that knows it is a bound method. I'd be okay if str(sys.exc_info) and str({}.update) were unchanged from today and if str(dict.update) returned 'dict.update', but if that's too complicated I'd also be okay with all three being unchanged, thus limiting this to Python functions (and classes and modules). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13224> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com