Python: List creation by multiplication operator time complexity

The former is O(n), due to the use of PyList_New() with a known size. The latter is slightly worse than O(n), due to the need to resize the list after several appends.

Leave a Comment