Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PyUnicode_FromFormat() and PyErr_Format() instead of sprintf #99426

Closed
serhiy-storchaka opened this issue Nov 13, 2022 · 0 comments
Closed
Labels
3.12 type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Nov 13, 2022

In some sites PyUnicode_FromFormat() and PyErr_Format() can be used instead of sprintf to a static or dynamically allocated buffer followed by (implicit) PyUnicode_FromString() or PyErr_SetString(). It would consume slightly more CPU and memory resources, but none of these places are performance critical and the new code is clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant