ls lib/python/
Python
CPython's containers, sorting and integers, read in the C source.
- draft Counter, most_common and heapq: top-k in the standard libraryHow collections.Counter counts, how most_common and heapq.nsmallest pick the top few, and why they break ties in opposite directions, read from the CPython 3.15.2 source.
- draft How a Python dict worksInside CPython 3.15's dict: the index table and entries array, the probe sequence, resizing, deletions, and why counting with a dict is linear.
- draft How Python sorts: runs, galloping and powersortWhat CPython 3.15's list.sort does with your data: natural runs, binary insertion sort, a powersort merge stack, galloping, and type-specialised compares.
- draft Multiplying a list in Python: loops, reduce, operator.mul and math.prodWhat a for loop, functools.reduce with a lambda or operator.mul, and math.prod actually execute in CPython 3.15, how fast each one is, and what changes once the product outgrows a machine word.