diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 69f5d64ca5c5d383de3fabdeb4d06d6f5a2f417b..991093e3443557946c43d555729f9d24f397d5c5 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1447,15 +1447,17 @@ available. They are listed here in alphabetical order. .. 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, new-style 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:: xrange([start,] stop[, step])