Commits

Lynn Rees committed fb94277 Merge

automerge

Comments (0)

Files changed (3)

 
 setup(
     name='stuf',
-    version='0.8.9',
+    version='0.8.10',
     description='''stuf has attributes''',
     long_description=open(os.path.join(os.getcwd(), 'README.rst'), 'r').read(),
     author='L. C. Rees',
 from stuf.core import defaultstuf, fixedstuf, frozenstuf, orderedstuf, stuf
 
 __all__ = ('defaultstuf', 'fixedstuf', 'frozenstuf', 'orderedstuf', 'stuf')
-__version__ = (0, 8, 9)
+__version__ = (0, 8, 10)
 
 
 idefaultstuf = defaultstuf
         pass
 
 
+def exhaustcall(call, iterator, exception=StopIteration, _n=next):
+    '''
+    call `next` on an iterator until it's exhausted
+
+    @param mapping: a mapping to exhaust
+    @param call: call to handle what survives the filter
+    @param filter: a filter to apply to mapping (default: `None`)
+    @param exception: exception sentinel (default: `StopIteration`)
+    '''
+    iterator = starmap(call, iterator)
+    try:
+        while True:
+            _n(iterator)
+    except exception:
+        pass
+
+
 def deleter(this, key):
     '''
     delete an attribute
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.