[issue7877] Iterators over _winreg EnumKey and EnumValue results

Tim Golden report at bugs.python.org
Mon Feb 8 17:12:32 CET 2010


Tim Golden <mail at timgolden.me.uk> added the comment:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
WindowsError: [Error 6] The handle is invalid

I suspect that .iterkeys / .itervalues would be more
acceptable spellings as those mirror the dict methods.
Whether the idea of extending _winreg beyond the absolute
basics will fly I'm not sure. I don't often use it, but
this would be useful if I did...

#
On 07/02/2010 21:31, Brian Curtin wrote:
>
> New submission from Brian Curtin<curtin at acm.org>:
>
> While EnumKey and EnumValue directly implement the underlying Windows calls of the same name, they don't feel very Pythonic. The user has to create their own loop and increment a counter to get all of the keys or values, stopping the loop when WindowsError is raised.
>
> I created IterKey and IterValue, iterators over RegEnumKeyEx and RegEnumValueEx respectively. This mainly began as playing around with writing Python iterators in C, but has proven to work pretty nicely so I figured I'd put it out there.
>
> Patch includes docs and tests. Comments/suggestions welcome and appreciated.
>
> ----------
> components: Library (Lib), Windows
> files: keyvalue_iterators.diff
> keywords: needs review, patch, patch
> messages: 99020
> nosy: brian.curtin
> priority: normal
> severity: normal
> stage: patch review
> status: open
> title: Iterators over _winreg EnumKey and EnumValue results
> type: feature request
> versions: Python 2.7, Python 3.2
> Added file: http://bugs.python.org/file16170/keyvalue_iterators.diff
>
> _______________________________________
> Python tracker<report at bugs.python.org>
> <http://bugs.python.org/issue7877>
> _______________________________________
> _______________________________________________
> Python-bugs-list mailing list
> Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/mail%40timgolden.me.uk

----------
nosy: +tim.golden

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


More information about the Python-bugs-list mailing list