Everything is an object in python - object class and type class

Chris Angelico rosuav at gmail.com
Wed Jun 3 06:38:29 EDT 2015


On Wed, Jun 3, 2015 at 8:20 PM, BartC <bc at freeuk.com> wrote:
> I have a lot of trouble with this stuff too, as my ideas are decidedly
> old-fashioned. (Also I'm developing a language with some OO aspects without
> ever having used OO!)
>
> But, it is mostly just jargon. If you go back to using 'variable' and
> 'type', then it becomes a bit easier:
>
> * A variable is an instance of some type.
>
> And, that's pretty much it!

If I have a list called "stuff" with three elements in it, is
"stuff[1]" a variable? What if I return that list from a function
called get_stuff()? Is get_stuff()[1] a variable? Because in Python,
get_stuff()[1] is certainly going to be an object.

ChrisA



More information about the Python-list mailing list