[issue7877] Iterators over _winreg EnumKey and EnumValue results

Daniel Stutzbach report at bugs.python.org
Wed Sep 1 14:23:01 CEST 2010


Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:

As most of the code in this patch was copied from EnumValue and EnumKey, it includes bugs from those functions that have since been fixed.  I'm thinking of Issue #2810, although there might have been other changes.

Instead of duplicating code, it would be better to abstract out some of the common elements so that in the future changes only need to be made in one place.

While winreg isn't very Pythonic, I imagine most users write a simple wrapper around the functions to give it a more Pythonic feel.  I have been using a home-brewed class that implements the MutableMapping ABC.  I just posted it as a recipe on ActiveState:

http://code.activestate.com/recipes/577381-collectionsmutablemapping-wrapper-around-_winreg/

----------
nosy: +stutzbach

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7877>
_______________________________________


More information about the Python-bugs-list mailing list