[issue17068] peephole optimization for constant strings

2019-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am thinking this should be closed. It isn't clear that it can be done easily or that there would be a measurable impact. Also, the advent of f-strings means that code like this will occur much less often -- both code examples presented would likely no l

[issue17068] peephole optimization for constant strings

2019-11-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- priority: normal -> low versions: +Python 3.9 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-lis

[issue17068] peephole optimization for constant strings

2019-11-29 Thread Batuhan
Batuhan added the comment: I think this operation is more suitable for AST optimizer then peephole but i'm still not sure if such a conversion gains anything compared to usage of old type string formattings. -- nosy: +BTaskaya ___ Python tracker

[issue17068] peephole optimization for constant strings

2019-04-13 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue17068] peephole optimization for constant strings

2013-02-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: It would also be nice to optimize '{}{}{}'.format('https://', host, uri). Either seems a bit much to ask from a fairly naive compiler :-). -- nosy: +terry.reedy stage: -> needs patch versions: +Python 3.4 ___ Python

[issue17068] peephole optimization for constant strings

2013-01-28 Thread STINNER Victor
STINNER Victor added the comment: > and realized this could be rewritten by the interpreter as: Yeah, it could but it's tricky to implement it. The current peephole is implemented in C. You may first try to implement it using my astoptimizer project which is implemented in Python. At least to

[issue17068] peephole optimization for constant strings

2013-01-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue17068] peephole optimization for constant strings

2013-01-28 Thread Neal Norwitz
New submission from Neal Norwitz: I was looking through code like this: foo = '%s%s%s' % ('https://', host, uri) and realized this could be rewritten by the interpreter as: foo = 'https://%s%s' % (host, uri) I tried to determine how much code this might affect, but it was pretty hard for