[docs] [issue15360] Behavior of assigning to __dict__ is not documented

Davide Rizzo report at bugs.python.org
Sun Jul 15 19:25:06 CEST 2012

New submission from Davide Rizzo <sorcio at gmail.com>:

The documentation (at least the obvious places, see Doc/reference/datamodel.rst) says classes and class instances have the '__dict__' attribute, but nothing is said about what happens when assigning to it (like obj.__dict__ = something).

As far as I understand that's undefined behavior and other implementations may not work the same as CPython (and CPython itself behaves differently between versions).

I'd submit a documentation patch if I knew how to specify this matter. Maybe just say the behavior is not defined?

assignee: docs at python
components: Documentation, Interpreter Core
messages: 165538
nosy: davide.rizzo, docs at python
priority: normal
severity: normal
status: open
title: Behavior of assigning to __dict__ is not documented
versions: Python 2.7, Python 3.3, Python 3.4

Python tracker <report at bugs.python.org>

More information about the docs mailing list