Why is `w2 == w3` True when one workout was told its calories and the other only estimated them?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Two workouts count as equal only when they are objects of the very same type and their start, end and kind all match. The checks build Workout objects and compare them with ==. Fill in the return line of Workout.__eq__ so that it follows that rule.
Comparing types first, then every data attribute
Write the parent's single return statement, type(self) == type(other) first and then the start, the end, the kind and the calories, and note the backslashes joining one logical line.
A one-line subclass comparison through super()
Write return super().__eq__(other) and self.elev == other.elev, and record what the parent call already covers and what remains on the line.
Six comparisons and their verdicts
Work through w1 == w2, w1 == w3, w2 == w3, w1 == rw1, rw1 == rw2 and rw1 == rw3, writing each result with the attribute that settles it.
Closing advice on building classes
Record improving a class a little at a time, that a data attribute may itself be an object, the warning against overengineering, and abstraction, modularity and information hiding together.