Author steven.daprano
Recipients docs@python, reed, steven.daprano
Date 2019-09-11.08:57:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568192278.26.0.984037092262.issue38099@roundup.psfhosted.org>
In-reply-to
Content
"The implementation adds a few special read-only attributes to several object TYPES" [emphasis added]

py> class MyType:
...     pass
...
py> MyType.__dict__ = {}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: attribute '__dict__' of 'type' objects is not writable



> What is the difference between an object and an instance?

In general, nothing. But ``object.__dict__`` refers to the special builtin *class* called "object". In hindsight, we should have called it Object, so we could more easily distinguish between the *class* called "object" and *instances* of that class.


py> print(object)  # the class/type itself
<class 'object'>

py> print(object())  # an instance of object
<object object at 0xb7ce1cd0>

The docs are correct here, but if you care to suggest some improvements, we will consider them.
History
Date User Action Args
2019-09-11 08:57:58steven.dapranosetrecipients: + steven.daprano, docs@python, reed
2019-09-11 08:57:58steven.dapranosetmessageid: <1568192278.26.0.984037092262.issue38099@roundup.psfhosted.org>
2019-09-11 08:57:58steven.dapranolinkissue38099 messages
2019-09-11 08:57:58steven.dapranocreate