This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Use PyUnicode_FromFomat instead of PyUnicode_Format for fixed formats
Type: Stage:
Components: Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, loewis, petri.lehtinen, python-dev
Priority: normal Keywords: patch

Created on 2011-11-05 21:30 by amaury.forgeotdarc, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
FromFormat.diff amaury.forgeotdarc, 2011-11-05 21:30 review
Messages (5)
msg147112 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-11-05 21:30
A code simplification suggested by a comment in issue13349:
Replace most usages of PyUnicode_Format (a.k.a. str.__mod__) by PyUnicode_FromFormat, which is easier to use from C:
no need to build a tuple, and the format accept both C strings (%s) and Python strings (%S or %R)
msg147144 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-11-06 07:13
+1
msg147154 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-11-06 11:52
This would chop unnecessary lines of code very nicely. +1
msg147159 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-06 14:15
New changeset 386a319b1825 by Amaury Forgeot d'Arc in branch 'default':
Issue #13350: Replace most usages of PyUnicode_Format by PyUnicode_FromFormat.
http://hg.python.org/cpython/rev/386a319b1825
msg147160 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-11-06 14:18
Now PyUnicode_Format is only called by unicode_mod...
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57559
2011-11-06 14:18:09amaury.forgeotdarcsetstatus: open -> closed
resolution: fixed
messages: + msg147160
2011-11-06 14:15:34python-devsetnosy: + python-dev
messages: + msg147159
2011-11-06 11:52:59petri.lehtinensetmessages: + msg147154
2011-11-06 07:13:29loewissetnosy: + loewis
messages: + msg147144
2011-11-05 21:30:34amaury.forgeotdarccreate