Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-14 Thread Armin Rigo
Hi Greg, On Wed, Feb 13, 2013 at 10:17 PM, Greg Ewing wrote: > If it's that unreliable, why was it ever implemented > in the first place? I was young and loved hacks and python-dev felt that it was a good idea at the time (http://mail.python.org/pipermail/python-dev/2004-August/046686.html). A

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Christian Tismer
On 13.02.13 22:52, Maciej Fijalkowski wrote: On Wed, Feb 13, 2013 at 11:17 PM, Greg Ewing wrote: Steven D'Aprano wrote: The documentation for strings is also clear that you should not rely on this optimization: ... It can, and does, fail on CPython as well, as it is sensitive to memory alloc

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Christian Tismer
Hi Lennart, Sent from my Ei4Steve On Feb 13, 2013, at 8:42, Lennart Regebro wrote: >> Something is needed - a patch for PyPy or for the documentation I guess. > > Not arguing that it wouldn't be good, but I disagree that it is needed. > > This is only an issue when you, as in your proof, have

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Maciej Fijalkowski
On Wed, Feb 13, 2013 at 11:17 PM, Greg Ewing wrote: > Steven D'Aprano wrote: >> >> The documentation for strings is also clear that you should not rely on >> this >> optimization: >> >> ... > >> >> >> It >> can, and does, fail on CPython as well, as it is sensitive to memory >> allocation details.

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Greg Ewing
Steven D'Aprano wrote: The documentation for strings is also clear that you should not rely on this optimization: > ... > It can, and does, fail on CPython as well, as it is sensitive to memory allocation details. If it's that unreliable, why was it ever implemented in the first place? --

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread R. David Murray
On Wed, 13 Feb 2013 18:07:22 +0100, Christian Tismer wrote: > I think before getting people to work through long and > complete documentation, it is probably easier to wake their interest > by something like > "Hey, are you doing things this way?" > And then there is a short, concise list of bad

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Christian Tismer
Hey Nick, On 13.02.13 15:44, Nick Coghlan wrote: On Wed, Feb 13, 2013 at 10:06 PM, Christian Tismer wrote: To avoid such hidden traps in larger code bases, documentation is needed that clearly gives a warning saying "don't do that", like CS students learn for most other languages. How much mo

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Nick Coghlan
On Wed, Feb 13, 2013 at 10:06 PM, Christian Tismer wrote: > To avoid such hidden traps in larger code bases, documentation is > needed that clearly gives a warning saying "don't do that", like CS > students learn for most other languages. How much more explicit do you want us to be? """6. CPytho

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Christian Tismer
On 13.02.13 13:10, Steven D'Aprano wrote: On 13/02/13 10:53, Christian Tismer wrote: Hi friends, _efficient string concatenation_ has been a topic in 2004. Armin Rigo proposed a patch with the name of the subject, more precisely: /[Patches] [ python-Patches-980695 ] efficient string concatenat

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Steven D'Aprano
On 13/02/13 10:53, Christian Tismer wrote: Hi friends, _efficient string concatenation_ has been a topic in 2004. Armin Rigo proposed a patch with the name of the subject, more precisely: /[Patches] [ python-Patches-980695 ] efficient string concatenation// //on sourceforge.net, on 2004-06-28./

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-13 Thread Christian Tismer
On 13.02.13 08:42, Lennart Regebro wrote: Something is needed - a patch for PyPy or for the documentation I guess. Not arguing that it wouldn't be good, but I disagree that it is needed. This is only an issue when you, as in your proof, have a loop that does concatenation. This is usually when

Re: [Python-Dev] efficient string concatenation (yep, from 2004)

2013-02-12 Thread Lennart Regebro
> Something is needed - a patch for PyPy or for the documentation I guess. Not arguing that it wouldn't be good, but I disagree that it is needed. This is only an issue when you, as in your proof, have a loop that does concatenation. This is usually when looping over a list of strings that should