[issue2444] Adding __iter__ to class Values of module optparse
Guilherme Polo
report at bugs.python.org
Sun Mar 23 23:12:48 CET 2008
Guilherme Polo <ggpolo at gmail.com> added the comment:
There is another reason for considering __iter__ as a more pythonic
solution here. If you print opts, it may lead you to believe that it is
just a regular dict, while it is not. If you were just able to iterate
over it, I think it would be more natural. I know you could check it and
then you would know it is not a dict, but I still prefer adding
a__iter__ method over using vars here.
About optparse being maintained separately.. isn't there someone
responsible that possibly checks this bugtracker ? If it is not the
case, and if __iter__ is agreed as a good solution, I could send this to
its own bugtracker then (if that is the best thing to do).
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2444>
__________________________________
More information about the Python-bugs-list
mailing list