Classes and Object-Oriented Programming in Python
Unlike some other object-oriented languages, Python doesn't force you to use the object-oriented paradigm exclusively: it also supports procedural programming with modules and functions, such that you can select the best paradigm for each part of your program or such that you can mix and match paradigms as needed. The object-oriented programming (OOP) helps you group state (data) and behaviour (code) together in self-contained scoped namespaces of functionality. OOP is also useful when you want to use some of Python's other object-oriented mechanisms, such as inheritance, overloading, and magic methods. In this post I cover the basics of classes, objects, and object-oriented programming from a Python syntax point of view.