An object is an instance (or not)?

Chris Angelico rosuav at gmail.com
Tue Jan 27 18:42:22 EST 2015


On Wed, Jan 28, 2015 at 10:22 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> I don't know what the difference is between "object" and "instance".  An
> object is an instance of a class.  The two words are interchangeable as far
> as I know.

My understanding is that "instance" is meaningless unless followed by
"of". That is to say, 123.45 is an object, and it is an instance *of*
the 'float' class. Everything in Python is an instance *of something*,
so in a sense, you can say that everything is an instance, but that's
like saying that everything has a color. Sure it does, but you need to
be more specific.

ChrisA



More information about the Python-list mailing list