[issue2444] Adding __iter__ to class Values of module optparse

Steven Bethard report at bugs.python.org
Wed Apr 2 17:34:30 CEST 2008


Steven Bethard <steven.bethard at gmail.com> added the comment:

Subclassing dict seems like a bad idea. The options value returned by
.parse_args() is not supposed to be dict-like, it's supposed to be
object-like. That is, the natural way of accessing values from it is
through dotted attribute access, not dict-indexing access. All the
documentation for the module makes this clear. Giving it both attribute
access and dict-indexing access would violate TOOWTDI. The One Obvious
way to get dict-indexing access from an attribute oriented object is
already vars().

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2444>
__________________________________


More information about the Python-bugs-list mailing list