Skip to content

Add PyUnicodeWriter API - #95

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:writer
Jul 18, 2024
Merged

Add PyUnicodeWriter API#95
vstinner merged 1 commit into
python:mainfrom
vstinner:writer

Conversation

@vstinner

Copy link
Copy Markdown
Member

TODO: update API doc.

@vstinner

Copy link
Copy Markdown
MemberAuthor

Wait until python/cpython#119184 is merged.

TODO: update API doc.
@vstinnervstinner changed the title WIP: Add PyUnicodeWriter APIAdd PyUnicodeWriter APIJul 18, 2024
@vstinner
vstinner marked this pull request as ready for review July 18, 2024 20:57
@vstinner
vstinner merged commit 4094c64 into python:mainJul 18, 2024
@vstinner
vstinner deleted the writer branch July 18, 2024 20:59
@seberg

Copy link
Copy Markdown

It seems to me that PyUnicodeWriter_WriteRepr and PyUnicodeWriter_WriteStr are missing the static inline to ensure multiple includes don't collide?

@vstinner

Copy link
Copy Markdown
MemberAuthor

It seems to me that PyUnicodeWriter_WriteRepr and PyUnicodeWriter_WriteStr are missing the static inline to ensure multiple includes don't collide?

Oops, fixed by #104.

@Rogdham

Rogdham commented Jun 20, 2025

Copy link
Copy Markdown
#ifPY_VERSION_HEX<0x030E0000&&PY_VERSION_HEX >= 0x03060000&& !defined(PYPY_VERSION)
// snipPyErr_Format(PyExc_TypeError, "expect str, not %T", str);

I did not experience the issue myself, but I think the %T format was introduced in gha-116839 (PEP-737), so may not be available on all versions of CPython?

@vstinner

Copy link
Copy Markdown
MemberAuthor

@Rogdham:

I did not experience the issue myself, but I think the %T format was introduced in python/cpython#116839 (PEP-737), so may not be available on all versions of CPython?

Oops, well spotted: I created #146 to fix the issue.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@seberg@Rogdham