An object is an instance (or not)?

Ben Finney ben+python at benfinney.id.au
Wed Jan 28 06:20:36 EST 2015


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:

> Ben Finney wrote:
>
> > * In the distant past of Python, some objects were not instances of any
> > class; the terminology in the documentation and messages shows some
> > confusing legacies from that ancient time.
>
>
> I presume you are referring to the type/class distinction?
>
> That is, in Python 1.5 (for example), the *instance* 23 was an
> instance of the *type* int but not of any class, as classes (created
> with the "class" keyword) were distinct from types.

That's what I was referring to, yes.

All ancient history now. In all current versions of Python, every type
is a class and every class is a type, and every type is an object and
every class is an object, and every object is an instance of a class and
is an instance of a type (and you are me and all are we together).

-- 
 \          “I like to reminisce with people I don't know. Granted, it |
  `\                                     takes longer.” —Steven Wright |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list