David Goudet
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).

--

--

David Goudet
David Goudet

Written by David Goudet

Senior Software Engineer from Venezuela living in Madrid. Top Writer in AI and Technology. US Dept of State alumnus. www.davidgoudet.com/peakperformance

No responses yet