Week 4: Objects and classes#
- What is an object?
- Surprise: we’ve been using objects!
- Which are method calls?
- Creating objects: constructors
- Using constructors
- Defining objects: classes
- Constructors
- Working with fields
- Sum
- Defining methods
- Adder
- Private fields with __
- SmallCounter
- Printing objects out
- Sum with
__repr__
- Objects and classes: recap
- Finding your way around
- Explaining what you’re about
- Doctest: putting your tests in your documentation
- Testing mean
- Inheritance
- Inheritance
- Classy testing
- Testing median