New submission from STINNER Victor: Attached patch adds tests to check that str%args and str.format(args) take all optimization opportunities for simple format strings. It takes also the fast-path when Unicode string argument when width and/or precision is set. For example, "%.3s" % "abc" now returns "abc" unmodified (instead of creating a copy). The patch also takes the fast-path when formatting integers with str%args when the argument is not an int, but an object with __int__ method.
---------- files: optimize_format.patch keywords: patch messages: 167827 nosy: haypo, pitrou priority: normal severity: normal status: open title: Format string: add more fast-path type: performance versions: Python 3.4 Added file: http://bugs.python.org/file26749/optimize_format.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15609> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com