Serhiy Storchaka added the comment: Because tp_name is a pointer to null-terminated C string and there is no way to distinguish the name containg the null byte from the name terminated by null byte. tp_name is used for example in error messages.
>>> t = type('B\0C', (), {}) >>> t.__name__ 'B\x00C' >>> t() + 0 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'B' and 'int' ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25961> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com