summaryrefslogtreecommitdiffstats
path: root/Doc/reference/datamodel.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-12 23:06:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-12 23:06:22 (GMT)
commit582162e42ba4c944fa96c15a99de29ea96ea9ca3 (patch)
treecf2d9057a3ede1221810619875d1976ae36bcd02 /Doc/reference/datamodel.rst
parent93f5cd42e7a2cc99a7a9670e7d0ea7db2290fcf3 (diff)
downloadcpython-582162e42ba4c944fa96c15a99de29ea96ea9ca3.zip
cpython-582162e42ba4c944fa96c15a99de29ea96ea9ca3.tar.gz
cpython-582162e42ba4c944fa96c15a99de29ea96ea9ca3.tar.bz2
Merged revisions 85392 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85392 | benjamin.peterson | 2010-10-12 17:57:59 -0500 (Tue, 12 Oct 2010) | 1 line prefer clearing global objects to obscure module.__dict__ bugs #10068 ........
Diffstat (limited to 'Doc/reference/datamodel.rst')
-rw-r--r--Doc/reference/datamodel.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 3d1d26d..9643f2b 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -654,6 +654,13 @@ Modules
Special read-only attribute: :attr:`__dict__` is the module's namespace as a
dictionary object.
+ .. impl-detail::
+
+ Because of the way CPython clears module dictionaries, the module
+ dictionary will be cleared when the module falls out of scope even if the
+ dictionary still has live references. To avoid this, copy the dictionary
+ or keep the module around while using its dictionary directly.
+
.. index::
single: __name__ (module attribute)
single: __doc__ (module attribute)