Objects within an object

while I was reading Python document I came across a line that said every thing is an object and a class is also an object.
I am trying to grasp meaning of objects within a single object. I was wondering then when methods are declared within a class, in actuality a class harbors references to the method objects that reside outside of the class object?

Then same for a list object. when within a single list there are int objects, list objects, string and all sorts of other type objects, what that single list is holding is not the objects per se, but the references to those objects that reside outside?

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

1 Like

You seem to be along the right lines but it depends exactly what you mean. In terms of memory at least then it is just references from one object to another (at least so far as I’m aware, I’ve not checked the actual implementation). Those fucntions are still bound to the class as far as scope is concerned.

1 Like

Yes, I was saying in terms of memory. To my understanding a memory is assigned to a single object, and I could not wrap my head around a single object having other objects within itself.
So therefore lists have a bunch of references to other objects.

Aye you’d not be storing any objects themselves in the list, just references to objects. The list itself is contiguous though (array style).