[Python-checkins] cpython (merge 3.3 -> default): merge

raymond.hettinger python-checkins at python.org
Sun Jun 2 19:05:17 CEST 2013


http://hg.python.org/cpython/rev/49bcd1af0f49
changeset:   84014:49bcd1af0f49
parent:      84012:25450fff5b90
parent:      84013:4c8426acd2cf
user:        Raymond Hettinger <python at rcn.com>
date:        Sun Jun 02 10:04:59 2013 -0700
summary:
  merge

files:
  Doc/library/functions.rst |  20 ++++++++++----------
  1 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1365,14 +1365,18 @@
 
 .. function:: vars([object])
 
-   Without an argument, act like :func:`locals`.
+   Return the :attr:`__dict__` attribute for a module, class, instance,
+   or any other object with a :attr:`__dict__` attribute.
 
-   With a module, class or class instance object as argument (or anything else that
-   has a :attr:`__dict__` attribute), return that attribute.
+   Objects such as modules and instances have an updateable :attr:`__dict__`
+   attribute; however, other objects may have write restrictions on their
+   :attr:`__dict__` attributes (for example, classes use a
+   dictproxy to prevent direct dictionary updates).
 
-   .. note::
-      The returned dictionary should not be modified:
-      the effects on the corresponding symbol table are undefined. [#]_
+   Without an argument, :func:`vars` acts like :func:`locals`.  Note, the
+   locals dictionary is only useful for reads since updates to the locals
+   dictionary are ignored.
+
 
 .. function:: zip(*iterables)
 
@@ -1491,7 +1495,3 @@
 .. [#] Note that the parser only accepts the Unix-style end of line convention.
    If you are reading the code from a file, make sure to use newline conversion
    mode to convert Windows or Mac-style newlines.
-
-.. [#] In the current implementation, local variable bindings cannot normally be
-   affected this way, but variables retrieved from other scopes (such as modules)
-   can be.  This may change.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list