One of the named data items that makes up an instance.
A user-defined compound type. A class can also be thought of as a template for the objects that are instances of it.
Every class has a “factory”, called by the same name as the class, for making new instances. If the class has an initializer method, this method is used to get the attributes (i.e. the state) of the new object properly set up.
- initializer method
A special method in Python (called
__init__) that is invoked automatically to set a newly created object’s attributes to their initial (factory-default) state.
An object whose type is of some class. The words instance and object are used interchangeably.
- instance variable
A variable that stores a value associated with the instance. The instance variables together store the state of an instance.
To create an instance of a class, and to run its initializer.
A function that is defined inside a class definition and is invoked on instances of that class.
A compound data type that is often used to model a thing or concept in the real world. It bundles together the data and the operations that are relevant for that kind of data. Instance and object are used interchangeably.
- object-oriented programming
A powerful style of programming in which data and the operations that manipulate it are organized into classes and methods.
- object-oriented language
A language that provides features, such as user-defined classes and inheritance, that facilitate object-oriented programming.