'Enumerates an open registry key as an iterable generator'

@staticmethod
def _enumerate_reg(key, func):

    try:
        for index in count():
            (yield func(key, index))
    except WindowsError:
        pass
