New submission from Brian Curtin <[email protected]>:

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 <[email protected]>
<http://bugs.python.org/issue7877>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to