- 1. Object Oriented Programming in Python
- 1.1. Why Object Oriented Programming?
- 1.2. Generic Object Oriented Programming terms
- 1.3. OOP in Python
- 1.4. OOP in Python (numbers, strings, lists)
- 1.5. OOP in Python (argparse)
- 1.6. Create a class
- 1.7. Create instance of class
- 1.8. Import module containing class
- 1.9. Import class from module
- 1.10. Initialize instance (not a constructor)
- 1.11. Self is the instance
- 1.12. Init uses same name as attribute and getters
- 1.13. Initialize an instance - (not a constructor), attributes and getters
- 1.14. Setters - assign to the attributes
- 1.15. Attributes are not special
- 1.16. Private attributes
- 1.17. Methods
- 1.18. Inheritance
- 1.19. Inheritance - another level
- 1.20. Modes of method inheritance
- 1.21. Modes of method inheritance - implicit
- 1.22. Modes of method inheritance - override
- 1.23. Modes of method inheritance - extend
- 1.24. Modes of method inheritance - delegate - provide
- 1.25. Composition - Line
- 1.26. Composition - Line with type annotation
- 1.27. Hidden attributes
- 1.28. Hidden attributes in a subclass
- 1.29. Some comments
- 1.30. Exercise: Add move_rad to based on radians
- 1.31. Exercise: Improve previous examples
- 1.32. Exercise: Polygon
- 1.33. Exercise: Number
- 1.34. Exercise: Library
- 1.35. Exercise: Bookexchange
- 1.36. Exercise: Represent turtle graphics
- 1.37. Solution - Polygon
- 2. Advanced OOP
- 2.1. Stringify class
- 2.2. Multiple inheritance
- 2.3. Multiple inheritance - diamond
- 2.4. Interfaces
- 2.5. Abstract Base Class
- 2.6. Abstract Base Class with abc
- 2.7. ABC working example
- 2.8. ABC - cannot instantiate the base-class
- 2.9. ABC - must implement methods
- 2.10. Class Attributes
- 2.11. Class count instances
- 2.12. Destructor: del
- 2.13. Class count instances - decrease also (destructor: del)
- 2.14. Keep track of instances
- 2.15. Keep track of instances properly (weakref)
- 2.16. Destructor delayed
- 2.17. Destructor delayed for both
- 2.18. Class Attributes in Instances
- 2.19. Attributes with method access
- 2.20. Methods are class attributes - add method
- 2.21. Methods are class attributes - replace method
- 2.22. Methods are class attributes - Enhance method (Monkey patching)
- 2.23. Method types
- 2.24. Instance methods
- 2.25. Class methods
- 2.26. Class methods accessing class attributes
- 2.27. Default Constructor
- 2.28. Alternative constructor with class method
- 2.29. Static methods
- 2.30. Module functions
- 2.31. Class and static methods
- 2.32. Special methods
- 2.33. Opearator overloading
- 2.34. Operator overloading methods
- 2.35. Declaring attributes (dataclasses)
- 2.36. Dataclasses and repr
- 2.37. Dataclasses and eq
- 2.38. Dataclasses create init and call post_init
- 2.39. Dataclasses can provide default values to attributes
- 2.40. Dataclasses and default factory
- 2.41. Read only (frozen) Dataclass
- 2.42. Serialization of instances with pickle
- 2.43. Class in function
- 2.44. Exercise: rectangle
- 2.45. Exercise: SNMP numbers
- 2.46. Exercise: Implement a Gene inheritance model combining DNA
- 2.47. Exercise: imaginary numbers - complex numbers
- 2.48. Solution: Rectangle
- 2.49. Solution: Implement a Gene inheritance model combining DNA
- 2.50. Instance Attribute
- 2.51. Use Python @propery to fix bad interface (the bad interface)
- 2.52. Use Python @propery to fix bad interface (first attempt)
- 2.53. Use Python @propery to fix bad API
- 2.54. Use Python @propery decorator to fix bad API
- 2.55. Use Python @propery for value validation
- 3. Other
- 3.1. Inheritance - super
- 3.2. Inheritance - super - other class
- 3.3. Abstract Base Class without abc
- 3.4. Abstract Base Class with abc Python 2 ?
- 3.5. Abstract Base Class with metaclass
- 3.6. Abstract Base Class without ABC