Commits

Lynn Rees committed 2319399

- tweaks for stuf 0.9.0

  • Participants
  • Parent commits 50240df
  • Tags 0.5.9

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