4 ms·
I'm a total newbie at Python, but wouldn't ''.join(map(chr, list)) avoid the quadratic time of doing "string += something" (and also be a prettier solution
by epidemian 15y ago
I'm a total newbie at Python, but wouldn't
''.join(map(chr, list))
avoid the quadratic time of doing "string += something" (and also be a prettier solution IMO)?
(In Python 2.x doing ''.join(chr(n) for n in list) might be a better solution to avoid the intermediate list created by map)
- sgk284 15y agoThe article is from 2002, so it's entire line of reasoning is quite outdated.