instance
An instance is a concrete occurrence of a class—a unique object created using a class as its template. When you create an instance, you’re making a specific copy of the class with its own set of data attributes.
Classes typically define an .__init__() method to set up the initial state of each instance. Each instance holds its own independent data, so changes to one instance don’t affect others.
Example
>>> class Dog:
... def __init__(self, name):
... self.name = name
...
>>> spot = Dog("Spot")
>>> rex = Dog("Rex")
>>> spot.name
'Spot'
>>> rex.name
'Rex'
Each Dog instance has its own .name attribute. You can check whether an object is an instance of a class using isinstance():
>>> isinstance(spot, Dog)
True
Related Resources
Tutorial
Python Class Constructors: Control Your Object Instantiation
In this tutorial, you'll learn how class constructors work in Python. You'll also explore Python's instantiation process, which has two main steps: instance creation and instance initialization.
For additional information on related topics, take a look at the following resources:
- Python's Instance, Class, and Static Methods Demystified (Tutorial)
- Object-Oriented Programming (OOP) (Learning Path)
- Using Python Class Constructors (Course)
- Python Class Constructors: Control Your Object Instantiation (Quiz)
- OOP Method Types in Python: @classmethod vs @staticmethod vs Instance Methods (Course)
- Python's Instance, Class, and Static Methods Demystified (Quiz)
By Dan Bader • Updated March 10, 2026