Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Always worth checking. Although the relative merits change when doing many joins to build up a single long string.

This recommendation is to go with .join() by default:

In performance sensitive parts of the library, the ''.join() form should be used instead. This will ensure that concatenation occurs in linear time across various implementations.http://www.python.org/dev/peps/pep-0008/

despite the fact it might not be better in CPython.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: