mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
gh-98836: Extend PyUnicode_FromFormat() (GH-98838)
* Support for conversion specifiers o (octal) and X (uppercase hexadecimal). * Support for length modifiers j (intmax_t) and t (ptrdiff_t). * Length modifiers are now applied to all integer conversions. * Support for wchar_t C strings (%ls and %lV). * Support for variable width and precision (*). * Support for flag - (left alignment).
This commit is contained in:
parent
6ba8406cb6
commit
f3466bc040
10 changed files with 584 additions and 287 deletions
|
|
@ -1849,14 +1849,11 @@ static PyObject *
|
|||
|
||||
kqueue_event_repr(kqueue_event_Object *s)
|
||||
{
|
||||
char buf[1024];
|
||||
PyOS_snprintf(
|
||||
buf, sizeof(buf),
|
||||
return PyUnicode_FromFormat(
|
||||
"<select.kevent ident=%zu filter=%d flags=0x%x fflags=0x%x "
|
||||
"data=0x%llx udata=%p>",
|
||||
(size_t)(s->e.ident), (int)s->e.filter, (unsigned int)s->e.flags,
|
||||
(unsigned int)s->e.fflags, (long long)(s->e.data), (void *)s->e.udata);
|
||||
return PyUnicode_FromString(buf);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue