Skip to content

Latest commit

 

History

History

README.md

Object-orientation

Some examples of object-oriented programming in Python.

What is it?

  • oo_programming.ipynb: introduction to object oriented programming.
  • points: the example used in the notebook.
  • polynomials: additional example of object-orientated code.
  • abstract_classes.ipynb: illustration of using abstract base classes.
  • avoiding_class_hierarchies.ipynb: illustration of duck typing, protocols and mix-in.
  • overloading.ipynb: illustration of function overloading using single dispatch.
  • inheritance.py: illustration of inheritance of class attributes.
  • multiple_inheritance.ipynb: notebook illustrating some aspects of multiple inheritance in Python.
  • mix-ins: illustration of mix-ins.
  • attr_intro.ipynb: illustration of how to use the attrs package.
  • f_string_user_defined_formats.ipynb: illustration of how to use f-strings with user-defined classes by overriding the __format__ method. It also illustrates the use of __new__ to create instances of a class while checking for validity of the arguments.