Wun Code
Python

Object-Oriented Python

Learn classes, special methods, inheritance and exceptions, and see how the libraries you use are built.

Start the trackFree, no sign-up needed

What you'll learn

  • Your first classData and behavior in one place
  • An object that describes itselfrepr for developers, str for users
  • When are two objects equal?Dict keys and set members
  • A class that acts like a listlen, in and for on your own class
  • Data classesWrite the fields, let Python write the rest
  • A class that inherits from anotherAdd your rule, leave the rest to the parent
  • A property that checks its valueEvery new value goes through the check
  • Alternative constructorsA clearly named constructor for each kind of input
  • Your own exceptionsCatch only what you can handle
  • Guaranteed cleanupThe with statement guarantees cleanup, whatever happens

Track contents

10 lessons, 2 hours in total
  1. 1Your first classPythonData and behavior in one place
  2. 2An object that describes itselfPythonrepr for developers, str for users
  3. 3When are two objects equal?PythonDict keys and set members
  4. 4A class that acts like a listPythonlen, in and for on your own class
  5. 5Data classesPythonWrite the fields, let Python write the rest
  6. 6A class that inherits from anotherPythonAdd your rule, leave the rest to the parent
  7. 7A property that checks its valuePythonEvery new value goes through the check
  8. 8Alternative constructorsPythonA clearly named constructor for each kind of input
  9. 9Your own exceptionsPythonCatch only what you can handle
  10. 10Guaranteed cleanupPythonThe with statement guarantees cleanup, whatever happens