Introduction to Classes
A class packs a set of data (variables) together with a set of functions operating on the data. This allows the programmer to compose new objects with content and behavior designed for the problem at hand. Most of the mathematical computations in this book can easily be coded without using classes, but classes often offer more elegant solutions or code that is easier to extend at a later stage. This chapter gives an introduction to the class concept in Python with emphasis on applications to numerical computing. We cover in particular constructions that allow user-designed objects to enter arithmetic expressions.