[Python-Dev] Usage of += on strings in loops in stdlib (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Wed Feb 13 12:28:32 CET 2013
- Previous message: [Python-Dev] Usage of += on strings in loops in stdlib
- Next message: [Python-Dev] efficient string concatenation (yep, from 2004)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12.02.13 23:03, Maciej Fijalkowski wrote:
How people feel about generally not having += on long strings in stdlib (since the refcount = 1 thing is a hack)?
Sometimes the use of += for strings or bytes is appropriate. For example, I deliberately used += for bytes instead b''.join() (note that there is even no such hack for bytes) in zipfile module where in most cases one of component is empty, and the concatenation of nonempty components only happens once. b''.join() was noticeably slower here.
- Previous message: [Python-Dev] Usage of += on strings in loops in stdlib
- Next message: [Python-Dev] efficient string concatenation (yep, from 2004)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]