This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.golden
Recipients brian.curtin, tim.golden
Date 2010-02-08.16:12:28
SpamBayes Score 7.2385276e-09
Marked as misclassified No
Message-id <4B7037E9.8070101@timgolden.me.uk>
In-reply-to <1265578300.82.0.0744515010877.issue7877@psf.upfronthosting.co.za>
Content
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@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@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
History
Date User Action Args
2010-02-08 16:12:32tim.goldensetrecipients: + tim.golden, brian.curtin
2010-02-08 16:12:29tim.goldenlinkissue7877 messages
2010-02-08 16:12:28tim.goldencreate