Dec 2, 2023
Built-in functions use CPython in the background:
len(s)
Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).
CPython implementation detail: len raises OverflowError on lengths larger than sys.maxsize, such as range(2 ** 100).