Lynn Rees avatar Lynn Rees committed 2319399

- tweaks for stuf 0.9.0

Comments (0)

Files changed (4)

 What's new in 0.5.8
 ===================
 
-- add new search expression support
+- add new search expression support
+
+What's new in 0.5.9
+===================
+
+- update to stuf 0.9.0

knife/__init__.py

 
 __all__ = ('knife', 'activeknife', 'lazyknife', '__')
 
-__version__ = (0, 5, 8)
+__version__ = (0, 5, 9)
 from threading import local
 from collections import deque
 
+from stuf.six import identity
 from stuf.utils import memoize
 from stuf.patterns import searcher
 
     @property
     def _identity(self):
         # use  generic identity function for worker if no worker assigned
-        return self._worker if self._worker is not None else lambda x: x
+        return self._worker if self._worker is not None else identity
 
     @property
     def _test(self, truth_=truth):
 from stuf.six.moves import filterfalse, zip_longest  # @UnresolvedImport
 from stuf.iterable import deferfunc, deferiter, count
 from stuf.collects import OrderedDict, Counter, ChainMap
-from stuf.six import filter, items, keys, map, strings, values
+from stuf.six import filter, items, keys, map, isstring, values, next
 
 Count = namedtuple('Count', 'least most overall')
 GroupBy = namedtuple('Group', 'keys groups')
 
     def _flatten(
         self, A=AttributeError, S=StopIteration, T=TypeError, nx=next,
-        st=strings, ii=isinstance,
+        st=isstring,
     ):
         def flatten(iterable):
             next_ = iterable.__iter__()
                     item = nx(next_)
                     try:
                         # don't recur over strings
-                        if ii(item, st):
+                        if st(item):
                             yield item
                         else:
                             # do recur over other things
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.