Sign up for 1-on-1 coaching at https://dougmercer.dev
—————————————————————————————————————————
In this video, we implement Python's range object in pure Python. We use this as a case study to explore Python's data model and learn how to create rich objects that interact naturally with Python's built-in operators and functions.
#python #objectorientedprogramming
Chapters
---------------
0:00 Introduction
1:02 What does range() do?
2:17 How will we test our implementation?
3:02 Start with a basic dataclass
3:27 Initialization
5:16 Iter
5:54 Contains
7:37 Len
9:35 Count & Index
10:26 Hash & Repr
10:59 Get Item
13:29 Reversed
13:56 Sequence
14:33 Final Thoughts