[New-bugs-announce] [issue26547] Undocumented use of the term dictproxy in vars() documentation

Julien report at bugs.python.org
Sat Mar 12 17:23:24 EST 2016

New submission from Julien:

I spotted un undocumented term here : https://docs.python.org/3.5/library/functions.html#vars

in: "Objects such as modules and instances have an updateable __dict__ attribute; however, other objects may have write restrictions on their __dict__ attributes (for example, classes use a dictproxy to prevent direct dictionary updates)."

The term "dictproxy" is not documented anywhere in the documentation, I assume it's a https://docs.python.org/3.4/library/types.html#types.MappingProxyType, which is right:

    >>> class Foo():
    ...     pass
    >>> vars(Foo)
    mappingproxy({'__doc__': None, '__weakref__': <attribute '__weakref__' of 'Foo' objects>, '__dict__': <attribute '__dict__' of 'Foo' objects>, '__module__': '__main__'})

So I propose a patch to link to it via a :class:`dictproxy <types.MappingProxyType>`.

Should we leave "dictproxy" or change it to "mappingproxy" ?

assignee: docs at python
components: Documentation
files: dictproxy.patch
keywords: patch
messages: 261665
nosy: docs at python, sizeof
priority: normal
severity: normal
status: open
title: Undocumented use of the term dictproxy in vars() documentation
type: enhancement
Added file: http://bugs.python.org/file42152/dictproxy.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list