Title: dict_proxy.keys() / values() / items() are lists
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.1, Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, daniel.urban, eric.araujo
Priority: normal Keywords:

Created on 2010-12-05 16:19 by daniel.urban, last changed 2010-12-07 03:47 by benjamin.peterson. This issue is now closed.

Messages (2)
msg123427 - (view) Author: Daniel Urban (daniel.urban) * (Python triager) Date: 2010-12-05 16:19
The keys, values and items methods of dict_proxy return a list, while dict.keys, etc. return dictionary views (dict_keys, etc.). dict_proxy is used as the __dict__ attribute of classes. This is documented at under "Custom classes" as "Special attributes: ... __dict__ is the dictionary containing the class’s namespace ..." While __dict__ is not actually dict, it probably should behave like a dict as close as possible. For example set operations work for dict.keys(), but not for dict_proxy.keys().
msg123520 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-12-07 03:47
Date User Action Args
2010-12-07 03:47:36benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg123520

resolution: fixed
2010-12-05 18:26:53eric.araujosetnosy: + eric.araujo
2010-12-05 16:19:04daniel.urbancreate