Classes - OOP - Object Oriented Programming
- Why Object Oriented Programming?
- Generic Object Oriented Programming terms
- OOP in Python
- OOP in Python (numbers, strings, lists)
- OOP in Python (argparse)
- Create a class
- Create instance of class
- Import module containing class
- Import class from module
- Initialize instance (not a constructor)
- Self is the instance
- Init uses same name as attribute and getters
- Initialize an instance - (not a constructor), attributes and getters
- Setters - assign to the attributes
- Attributes are not special
- Private attributes
- Methods
- Inheritance
- Inheritance - another level
- Modes of method inheritance
- Modes of method inheritance - implicit
- Modes of method inheritance - override
- Modes of method inheritance - extend
- Modes of method inheritance - delegate - provide
- Composition - Line
- Composition - Line with type annotation
- Hidden attributes
- Hidden attributes in a subclass
- Some comments
- Exercise: Add move_rad to based on radians
- Exercise: Improve previous examples
- Exercise: Polygon
- Exercise: Number
- Exercise: Library
- Exercise: Bookexchange
- Exercise: Represent turtle graphics
- Solution - Polygon