Message324675
| Author |
vstinner |
| Recipients |
vstinner |
| Date |
2018年09月06日.09:13:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1536225210.1.0.56676864532.issue34595@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The PEP 399 requires that C accelerator behaves exactly as Python, but a lot of C code truncates type name to an arbitrary length: 80, 100, 200, up to 500 (not sure if it's a number of bytes or characters).
Py_TYPE(obj)->tp_name is a common pattern: it would be nice to have a new "%T" format in PyUnicode_FromFormat(), so it can be used directly in PyErr_Format(), to format an object type name.
Attached PR implements the proposed %T format and modify unicodeobject.c to use it.
I propose to then write a second PR to modify all C code of CPython using Py_TYPE(obj)->tp_name to use the new %T type. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2018年09月06日 09:13:30 | vstinner | set | recipients:
+ vstinner |
| 2018年09月06日 09:13:30 | vstinner | set | messageid: <1536225210.1.0.56676864532.issue34595@psf.upfronthosting.co.za> |
| 2018年09月06日 09:13:30 | vstinner | link | issue34595 messages |
| 2018年09月06日 09:13:29 | vstinner | create |
|