Increase number of items for which list.extend([...]) is optimised....
Increase number of items for which list.extend([...]) is optimised. Benchmarking shows that append() is still faster for 8 items (on an empty list) than extend(). This limit could be increased for larger lists (which grow by a larger amount), but if we have to settle on one value then 8 is good enough, as we can expect literal item lists to be rather short.
Showing
Please register or sign in to comment