DO-NOT-MERGE: bpo-34595: Add %t format to PyUnicode_FromFormatV()#9122
DO-NOT-MERGE: bpo-34595: Add %t format to PyUnicode_FromFormatV()#9122vstinner wants to merge 1 commit into
Conversation
* The %T format of PyUnicode_FromFormatV() now returns the fully qualified name of an object type (ex: "module.namespace.typename"). * Add %t format to PyUnicode_FromFormatV(), and so to PyUnicode_FromFormat() and PyErr_Format(), to format the "short name" of an object type: equivalent to "%s" with _PyType_Name(Py_TYPE(obj)). * Replace %T format with %t format in unicodeobject.c. * Update existing NEWS entry
|
I rebased my changed and made requested changes. |
Sorry, something went wrong.
|
I propose to replace Py_TYPE(obj)->tp_name with %t in C to mimick Python code which uses type(obj).name or obj.class.name. If we want to use %T in C code, I suggest to also update the related Python code, especially for "C accelerators" modules like _asyncio/_pickle. I suggest to only start to use %T on a case by base basis. |
Sorry, something went wrong.
|
#Linux-PR_20180911.05 failed: the CI is broken, it failed on apt-get install. |
Sorry, something went wrong.
|
I changed the status of this PR to "DO-NOT-MERGE", since Petr Viktorin asked me to open a discussion on python-dev: |
Sorry, something went wrong.
qualified name of an object type (ex: "module.namespace.typename").
PyUnicode_FromFormat() and PyErr_Format(), to format the "short
name" of an object type: equivalent to "%s" with
_PyType_Name(Py_TYPE(obj)).
https://bugs.python.org/issue34595