Glossary 12
class: A user-defined compound type. A class can also be thought of as a template for the objects that are instances of it.
instantiate: To create an instance of a class.
instance: An object that belongs to a class.
object: A compound data type that is often used to model a thing or concept in the real world.
constructor: A method used to create new objects.
attribute: One of the named data items that makes up an instance.
shallow equality: Equality of references, or two references that point to the same object.
deep equality: Equality of values, or two references that point to objects that have the same value.
shallow copy: To copy the contents of an object, including any references to embedded objects; implemented by the copy function in the copy module.
deep copy: To copy the contents of an object as well as any embedded objects, and any objects embedded in them, and so on; implemented by the deepcopy function in the copy module.
Glossary 13
pure function: A function that does not modify any of the objects it receives as arguments. Most pure functions are fruitful.
modifier: A function that changes one or more of the objects it receives as arguments. Most modifiers are fruitless.
functional programming style: A style of program design in which the majority of functions are pure.
prototype development: A way of developing programs starting with a prototype and gradually testing and improving it.
planned development: A way of developing programs that involves high-level insight into the problem and more planning than incremental development or prototype development.
algorithm: A set of instructions for solving a class of problems by a mechanical, unintelligent process.
Glossary 14
object-oriented language: A language that provides features, such as userdefined classes and inheritance, that facilitate object-oriented programming.
object-oriented programming: A style of programming in which data and the operations that manipulate it are organized into classes and methods.
method: A function that is defined inside a class definition and is invoked on instances of that class.
override: To replace a default. Examples include replacing a default value with a particular argument and replacing a default method by providing a new method with the same name.
initialization method: A special method that is invoked automatically when a new object is created and that initializes the object’s attributes.
operator overloading: Extending built-in operators (+, -, *, >, <, etc.) so that they work with user-defined types.
dot product: An operation defined in linear algebra that multiplies two Points and yields a numeric value.
scalar multiplication: An operation defined in linear algebra that multiplies each of the coordinates of a Point by a numeric value.
polymorphic: A function that can operate on more than one type. If all the operations in a function can be applied to a type, then the function can be applied to a type.
Glossary 15
encode: To represent one set of values using another set of values by constructing a mapping between them.
class attribute: A variable that is defined inside a class definition but outside any method. Class attributes are accessible from any method in the class and are shared by all instances of the class.
accumulator: A variable used in a loop to accumulate a series of values, such as by concatenating them onto a string or adding them to a running sum.