Eli Bendersky added the comment: In Objects/unicodeobject.c when it gets into mainformatlong, an IntEnum is recognized as an integer (passes PyLong_Check) and goes into formatlong. There, in the cases of 'd', 'i', 'u' it has:
case 'u': /* Special-case boolean: we want 0/1 */ if (PyBool_Check(val)) result = PyNumber_ToBase(val, 10); else result = Py_TYPE(val)->tp_str(val); break; So tp_str is invoked... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18738> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com