def id_generator():
    '''a generator returning numeric ID's as identifiers'''
    _id = 0
    while True:
        _id += 1
        if _id == maxint:
            _id = 0
        yield _id
a generator returning numeric ID's as identifiers
recipes/Python/576632_Queue_with_tagged_items/recipe-576632.py