Skip to content

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

Python
>>> 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():

Python
>>> isinstance(spot, Dog)
True

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.

intermediate python

For additional information on related topics, take a look at the following resources:


By Dan Bader • Updated March 10, 2026