This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author shawnmorel
Recipients bethard, djc, gpolo, gward, rhettinger, shawnmorel
Date 2008-04-02.13:08:46
SpamBayes Score 0.08375187
Marked as misclassified No
Message-id <1207141727.86.0.829053679893.issue2444@psf.upfronthosting.co.za>
In-reply-to
Content
gpolo: The argument still doesn't hold. As you point out, it's the 
Values class output from __str__ and other behaviour that is being un-
pythonic and leading you to believe it's a dictionary. Adding the 
__itter__ method would only make this worse. Then someone else would 
surely ask to have another __*__ method added since dictionaries support 
it but values don't.

The question then is one for optik. Why doesn't values simply inherit 
from dict and why does it insist on using __setattr__ rather than 
actually behaving completely like a dictionary. I know I was completely surprised by the following:

>>> (opts, args) = parser.parse_args(values={})
>>> print opts
{}
>>>
History
Date User Action Args
2008-04-02 13:08:48shawnmorelsetspambayes_score: 0.0837519 -> 0.08375187
recipients: + shawnmorel, gward, rhettinger, bethard, gpolo, djc
2008-04-02 13:08:47shawnmorelsetspambayes_score: 0.0837519 -> 0.0837519
messageid: <1207141727.86.0.829053679893.issue2444@psf.upfronthosting.co.za>
2008-04-02 13:08:46shawnmorellinkissue2444 messages
2008-04-02 13:08:46shawnmorelcreate