Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Disambiguating Class and Instance

00:00 Class and instance. Let’s clear up those terms a little bit, because you’ll be working very heavily with classes and instances, and it’s very important that you have a clear idea of what each means.

00:12 A class you can think of like a blueprint. You can think of it like a prototype or a model. The instance, on the other hand, is a specimen or a occurrence or an occasion.

00:26 So in the case of a blueprint, you’d have a blueprint maybe for a car, and the instance would be the actual car. Let’s look at a few examples. Here you have classes on the left and examples of the instances on the right.

00:40 So as a class, you could have the mammal Canis familiaris, also known as dogs. And the instance of this class could be your dog Spike. Likewise, you can have the concept of a point in two-dimensional space with an x and y coordinate, and then you can have an instance of a point which is the center of a canvas that you’re going to draw on.

01:01 And you can have the idea of a chair. So everyone knows what a chair is. It’s something that you can sit on, but the instance is the actual chair or the many chairs that are available for you to sit on.

01:14 Just to hammer this home, a class is like a blueprint, and an instance is something that is made from a blueprint. Now all of these analogies and examples are just to help you really understand the difference between classes and instance when it comes to Python.

01:31 Remember that analogies are limited. None of these analogies really fully encapsulate everything that goes into a Python class and instance.

Become a Member to join the conversation.