Commits

Lynn Rees committed 7086040

- fix tests

  • Participants
  • Parent commits e35a47a
  • Branches next

Comments (0)

Files changed (18)

 
 setup(
     name='twoq',
-    version='0.4.14',
+    version='0.5.0',
     description='iterator chaining, underscored by a two-headed queue',
     long_description=open(join(getcwd(), 'README.rst'), 'r').read(),
     keywords='queue generator utility iterator functional programming',
 '''iterator chaining, underscored by a two-headed queue'''
 
 from twoq.support import port
-from twoq.active.queuing import twoq, manq, autoq
+from twoq.active.core import twoq, manq, autoq
 
 __all__ = ('twoq', 'manq', 'autoq', 'port')
-__version__ = (0, 4, 14)
+__version__ = (0, 5, 0)

twoq/active/core.py

+# -*- coding: utf-8 -*-
+'''twoq active queues'''
+
+from twoq.core import SLOTS
+from twoq.mapping import MappingMixin as MapMixin
+from twoq.ordering import OrderingMixin as OrderMixin
+from twoq.reducing import ReducingMixin as ReduceMixin
+from twoq.filtering import FilteringMixin as FilterMixin
+
+from twoq.active.mixins import AutoResultMixin, ManResultMixin
+
+__all__ = ('autoq', 'manq')
+
+
+class autoq(AutoResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
+
+    '''auto-balancing manipulation queue'''
+
+    __slots__ = SLOTS
+
+
+class manq(ManResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
+
+    '''manually balanced manipulation queue'''
+
+    __slots__ = SLOTS
+
+
+twoq = autoq

twoq/active/mixins.py

 
     '''base active things'''
 
-    def __init__(self, *things):
+    def __init__(self, *things, **kw):
         try:
             incoming = deque(things[0]) if len(things) == 1 else deque(things)
         except TypeError:
     ## savepoint for things ###################################################
     ###########################################################################
 
-    def savepoint(self):
+    def _savepoint(self):
         '''take savepoint of incoming things'''
         self._savepoints.append(copy(getattr(self, self._INQ)))
         return self
 
     def __iter__(self):
         '''yield outgoing things, clearing outgoing things as it iterates'''
-        return self._iterexcept(getattr(self, self._OUTQ), IndexError)
+        return self._iterexcept(self._OUTQ)
 
     @property
     def _iterable(self):
             id(self),
         )
 
-    def outcount(self):
+    def countout(self):
         '''number of outgoing things'''
         return len(self.outgoing)
 
     ## clear things ###########################################################
     ###########################################################################
 
-    def _uclear(self):
+    def _clearu(self):
         '''clear utility things'''
         self._util.clear()
         return self
 
-    def _wclear(self):
+    def _clearw(self):
         '''clear work things'''
         self._work.clear()
         return self
 
-    def inclear(self):
+    def clearin(self):
         '''clear incoming things'''
         self.incoming.clear()
         return self
 
-    def outclear(self):
+    def clearout(self):
         '''clear outgoing things'''
         self.outgoing.clear()
         return self
 
     '''auto-balancing queue mixin'''
 
-    _default_context = 'autoctx'
+    _DEFAULT_CONTEXT = 'autoctx'
 
 
 class ManMixin(BaseMixin):
 
     '''manually balanced queue mixin'''
 
-    _default_context = 'ctx4'
+    _DEFAULT_CONTEXT = 'ctx4'
 
 
 class EndMixin(ResultsMixin):
         wrap, outgoing = self._wrapper, self.outgoing
         out = self.outgoing.pop() if len(outgoing) == 1 else wrap(outgoing)
         # clear every last thing
-        self.clear()._ssclear()
+        self.clear()._clearsp()
         return out
 
     def snapshot(self):
         wrap, outgoing = self._wrapper, self.outgoing
         out = self.outgoing.pop() if len(outgoing) == 1 else wrap(outgoing)
         # clear outgoing things
-        self.outclear()
+        self.clearout()
         return out
 
 

twoq/active/queuing.py

-# -*- coding: utf-8 -*-
-'''twoq active queues'''
-
-from twoq.core import SLOTS
-from twoq.mapping import MappingMixin as MapMixin
-from twoq.ordering import OrderingMixin as OrderMixin
-from twoq.reducing import ReducingMixin as ReduceMixin
-from twoq.filtering import FilteringMixin as FilterMixin
-
-from twoq.active.mixins import AutoResultMixin, ManResultMixin
-
-__all__ = ('autoq', 'manq')
-
-
-class autoq(AutoResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
-
-    '''auto-balancing manipulation queue'''
-
-    __slots__ = SLOTS
-
-
-class manq(ManResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
-
-    '''manually balanced manipulation queue'''
-
-    __slots__ = SLOTS
-
-
-twoq = autoq
         ## context defaults ###################################################
         #######################################################################
         # preferred context
-        self._context = self._default_context
+        self._context = getattr(self, self._DEFAULT_CONTEXT)
         # default context settings
         self._CONFIG = {}
         # 1. default incoming things
     def rw(self):
         '''switch to read/write mode'''
         self.current_mode = self._RW
-        return self._uclear().unswap()
+        return self._clearu().unswap()
 
     ###########################################################################
     ## context things #EE######################################################
         # savepoint
         savepoint = kw.pop('savepoint', True)
         if savepoint:
-            self.savepoint()
+            self._savepoint()
         # keep context-specific settings between context swaps
         self._CONFIG = kw if kw.get('hard', False) else {}
         # set context
-        self._context = kw.get('context', getattr(self, self._default_context))
+        self._context = kw.get('context', getattr(self, self._DEFAULT_CONTEXT))
         # clear out outgoing things before extending them?
         self._clearout = kw.get('clearout', True)
         # 1. incoming things
         self.reswap()
 
     ###########################################################################
-    ## savepoint for things ###################################################
+    ## savepoint for things ##################################################
     ###########################################################################
 
     def _original(self):
         '''preserve original incoming things'''
-        self.savepoint()
+        self._savepoint()
         # preserve from savepoint stack
         self._start = self._savepoints.pop()
         return self
 
-    def undo(self, index=0):
+    def undo(self, index=0, everything=False):
         '''
         revert to previous savepoint
 
-        @param savepoint: index of savepoint (default: 0)
+        @param index: index of savepoint (default: 0)
+        @param everything: undo everything and return things to original state
         '''
+        if everything:
+            self.clear()._clearsp()
+            self.incoming = self._start
+            self._original()
+            return self
         self.clear()
         if not index:
             self.incoming = self._savepoints.pop()
             self._savepoints.reverse()
             self.incoming = self._savepoints[index]
             self._savepoints.reverse()
-        return self.savepoint()
-
-    def rollback(self):
-        '''revert to original things'''
-        self.clear()._ssclear()
-        self.incoming = self._start
-        self._original()
-        return self
+        return self._savepoint()
 
     ###########################################################################
     ## rotate things ##########################################################
         with self.autoctx(inq=self._OUTVAR, outq=self._INVAR):
             return self._xtend(self._iterable)
 
-    def outsync(self):
+    def syncout(self):
         '''shift incoming things to outgoing things'''
         with self.autoctx():
             return self._xtend(self._iterable)
     @property
     def balanced(self):
         '''queues are balanced?'''
-        return self.outcount() == self.__len__()
+        return self.countout() == self.__len__()
 
     ###########################################################################
     ## clear things ###########################################################
     ###########################################################################
 
-    def _ssclear(self):
+    def _clearsp(self):
         '''clear savepoints'''
         self._savepoints.clear()
         return self
 
     def clear(self):
         '''clear anything'''
-        return self.untap().unwrap().outclear().inclear()._wclear()._uclear()
+        return self.untap().unwrap().clearout().clearin()._clearw()._clearu()
 
 
 class ResultsMixin(local):

twoq/filtering.py

                 pass
 
     def members(self):
-        '''collect object members from incoming things'''
+        '''extract object members from incoming things'''
         with self._context():
-            mfilter, call = self._mfilter, self._call
+            walk_ = self._extract
+            call_, alt_, wrap_ = self._call, self._alt, self._wrapper
             return self._xtend(ichain(imap(
-                lambda x: mfilter(call, x), self._iterable,
+                lambda x: walk_(call_, alt_, wrap_, x), self._iterable,
             )))
 
     def mro(self):

twoq/lazy/core.py

+# -*- coding: utf-8 -*-
+'''twoq lazy queues'''
+
+from twoq.core import SLOTS
+from twoq.mapping import MappingMixin as MapMixin
+from twoq.ordering import OrderingMixin as OrderMixin
+from twoq.reducing import ReducingMixin as ReduceMixin
+from twoq.filtering import FilteringMixin as FilterMixin
+
+from twoq.lazy.mixins import AutoResultMixin, ManResultMixin
+
+
+class autoq(AutoResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
+
+    '''auto-balancing manipulation queue'''
+
+    __slots__ = SLOTS
+
+
+class manq(ManResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
+
+    '''manually balanced manipulation queue'''
+
+    __slots__ = SLOTS
+
+
+lazyq = autoq

twoq/lazy/mixins.py

 
     '''base lazy things'''
 
-    def __init__(self, *things):
+    def __init__(self, *things, **kw):
+
         try:
             incoming = iter([things[0]]) if len(things) == 1 else iter(things)
         except TypeError:
         )
 
     ###########################################################################
-    ## snapshots ##############################################################
+    ## mode things ############################################################
     ###########################################################################
 
-    def savepoint(self):
+    def ro(self):
+        '''switch to read-only mode'''
+        with self.ctx3(outq=self._UTILVAR, savepoint=False):
+            self._xreplace(self._iterable)
+        with self.ctx1(hard=True, workq=self._UTILVAR, savepoint=False):
+            self.current_mode = self._RO
+            return self
+
+    ###########################################################################
+    ## context things #########################################################
+    ###########################################################################
+
+    @contextmanager
+    def ctx2(self, **kw):
+        '''swap for two-armed context'''
+        self.swap(
+            context=self.ctx2, outq=kw.get(self._OUTCFG, self._INVAR), **kw
+        )._clearworking()
+        setr_ = lambda x, y: setattr(self, x, y)
+        getr_ = lambda x: getattr(self, x)
+        OUTQ = self._OUTQ
+        # extend work things with outgoing things
+        work, out = tee(getr_(OUTQ))
+        setr_(self._WORKQ, work)
+        setr_(OUTQ, out)
+        yield
+        # extend outgoing things with utility things
+        util = getr_(self._UTILQ)
+        setr_(
+            self._OUTQ,
+            util if self._clearout else chain(util, getr_(self._OUTQ)),
+        )
+        self._clearworking()
+        # return to global context
+        self.reswap()
+
+    @contextmanager
+    def ctx3(self, **kw):
+        '''swap for three-armed context'''
+        self.swap(
+            utilq=kw.get(self._WORKCFG, self._WORKVAR), context=self.ctx3, **kw
+        )._clearworking()
+        setr_ = lambda x, y: setattr(self, x, y)
+        getr_ = lambda x: getattr(self, x)
+        INQ = self._INQ
+        # extend work things with incoming things
+        work, inq = tee(getr_(INQ))
+        setr_(self._WORKQ, work)
+        setr_(INQ, inq)
+        yield
+        # extend outgoing things with utility things
+        util = getr_(self._UTILQ)
+        setr_(
+            self._OUTQ,
+            util if self._clearout else chain(util, getr_(self._OUTQ)),
+        )
+        self._clearworking()
+        # return to global context
+        self.reswap()
+
+    @contextmanager
+    def ctx4(self, **kw):
+        '''swap for four-armed context'''
+        self.swap(context=self.ctx4, **kw)._clearworking()
+        setr_ = lambda x, y: setattr(self, x, y)
+        getr_ = lambda x: getattr(self, x)
+        INQ = self._INQ
+        # extend work things with incoming things
+        work, inq = tee(getr_(INQ))
+        setr_(self._WORKQ, work)
+        setr_(INQ, inq)
+        yield
+        # extend outgoing things with utility things
+        util = getr_(self._UTILQ)
+        setr_(
+            self._OUTQ,
+            util if self._clearout else chain(util, getr_(self._OUTQ)),
+        )
+        self._clearworking()
+        # return to global context
+        self.reswap()
+
+    @contextmanager
+    def autoctx(self, **kw):
+        '''swap for auto-synchronizing context'''
+        self.swap(context=self.autoctx, **kw)._clearworking()
+        setr_ = lambda x, y: setattr(self, x, y)
+        getr_ = lambda x: getattr(self, x)
+        INQ = self._INQ
+        # extend work things with incoming things
+        work, inq = tee(getr_(INQ))
+        setr_(self._WORKQ, work)
+        setr_(INQ, inq)
+        yield
+        # extend incoming things and outgoing things with utility things
+        inq, out = tee(getr_(self._UTILQ))
+        setr_(
+            self._OUTQ,
+            out if self._clearout else chain(out, getr_(self._OUTQ)),
+        )
+        setr_(INQ, inq)
+        self._clearworking()
+        # return to global context
+        self.reswap()
+
+    ###########################################################################
+    ## savepoint for things ###################################################
+    ###########################################################################
+
+    def _savepoint(self):
         '''take savepoint of incoming'''
         savepoint, self.incoming = tee(getattr(self, self._INQ))
         self._savepoints.append(savepoint)
         return self
 
     ###########################################################################
-    ## length #################################################################
-    ###########################################################################
-
-    def __len__(self):
-        '''number of incoming things'''
-        self.incoming, incoming = tee(self.incoming)
-        return len(list(incoming))
-
-    def outcount(self):
-        '''number of outgoing things'''
-        self.outgoing, outgoing = tee(self.outgoing)
-        return len(list(outgoing))
-
-    ###########################################################################
-    ## iterators ##############################################################
+    ## iterate things #########################################################
     ###########################################################################
 
     def __iter__(self):
         return getattr(self, self._WORKQ)
 
     ###########################################################################
-    ## clear things ###########################################################
-    ###########################################################################
-
-    def _clearwork(self):
-        '''clear work things and utility things'''
-        iter_ = iter
-        setr_ = lambda x, y: setattr(self, x, y)
-        delr_ = lambda x: delattr(self, x)
-        WORKQ, UTILQ = self._WORKQ, self._UTILQ
-        # clear work things
-        delr_(WORKQ)
-        setr_(WORKQ, iter_([]))
-        # clear utility things
-        delr_(UTILQ)
-        setr_(UTILQ, iter_([]))
-        return self
-
-    def _uclear(self):
-        '''clear utility things'''
-        UTILQ = self._UTILQ
-        delattr(self, UTILQ)
-        setattr(self, UTILQ, iter([]))
-        return self
-
-    def _wclear(self):
-        '''clear work things'''
-        WORKQ = self._WORKQ
-        delattr(self, WORKQ)
-        setattr(self, WORKQ, iter([]))
-        return self
-
-    def inclear(self):
-        '''clear incoming things'''
-        INQ = self._INQ
-        delattr(self, INQ)
-        setattr(self, INQ, iter([]))
-        return self
-
-    def outclear(self):
-        '''clear outgoing things'''
-        OUTQ = self._OUTQ
-        delattr(self, OUTQ)
-        setattr(self, OUTQ, iter([]))
-        return self
-
-    ###########################################################################
-    ## extend #################################################################
+    ## extend things ##########################################################
     ###########################################################################
 
     def _xtend(self, thing):
         return self.__buildchain(iter(things))
 
     ###########################################################################
-    ## append #################################################################
+    ## append things ##########################################################
     ###########################################################################
 
     def _append(self, things):
         return self.__buildchain(iter([things]))
 
     ###########################################################################
-    ## context rotation #######################################################
+    ## know things ############################################################
     ###########################################################################
 
-    @contextmanager
-    def ctx2(self, **kw):
-        '''swap for two-armed context'''
-        self.swap(
-            context=self.ctx2, outq=kw.get(self._OUTCFG, self._INVAR), **kw
-        )._clearwork()
+    def __len__(self):
+        '''number of incoming things'''
+        self.incoming, incoming = tee(self.incoming)
+        return len(list(incoming))
+
+    def countout(self):
+        '''number of outgoing things'''
+        self.outgoing, outgoing = tee(self.outgoing)
+        return len(list(outgoing))
+
+    ###########################################################################
+    ## clear things ###########################################################
+    ###########################################################################
+
+    def _clearworking(self):
+        '''clear work things and utility things'''
+        iter_ = iter
         setr_ = lambda x, y: setattr(self, x, y)
-        getr_ = lambda x: getattr(self, x)
+        delr_ = lambda x: delattr(self, x)
+        WORKQ, UTILQ = self._WORKQ, self._UTILQ
+        # clear work things
+        delr_(WORKQ)
+        setr_(WORKQ, iter_([]))
+        # clear utility things
+        delr_(UTILQ)
+        setr_(UTILQ, iter_([]))
+        return self
+
+    def _clearu(self):
+        '''clear utility things'''
+        UTILQ = self._UTILQ
+        delattr(self, UTILQ)
+        setattr(self, UTILQ, iter([]))
+        return self
+
+    def _clearw(self):
+        '''clear work things'''
+        WORKQ = self._WORKQ
+        delattr(self, WORKQ)
+        setattr(self, WORKQ, iter([]))
+        return self
+
+    def clearin(self):
+        '''clear incoming things'''
+        INQ = self._INQ
+        delattr(self, INQ)
+        setattr(self, INQ, iter([]))
+        return self
+
+    def clearout(self):
+        '''clear outgoing things'''
         OUTQ = self._OUTQ
-        # extend work things with outgoing things
-        work, out = tee(getr_(OUTQ))
-        setr_(self._WORKQ, work)
-        setr_(OUTQ, out)
-        yield
-        # extend outgoing things with utility things
-        util = getr_(self._UTILQ)
-        setr_(
-            self._OUTQ,
-            util if self._clearout else chain(util, getr_(self._OUTQ)),
-        )
-        self._clearwork()
-        # return to global context
-        self.reswap()
-
-    @contextmanager
-    def ctx3(self, **kw):
-        '''swap for three-armed context'''
-        self.swap(
-            utilq=kw.get(self._WORKCFG, self._WORKVAR), context=self.ctx3, **kw
-        )._clearwork()
-        setr_ = lambda x, y: setattr(self, x, y)
-        getr_ = lambda x: getattr(self, x)
-        INQ = self._INQ
-        # extend work things with incoming things
-        work, inq = tee(getr_(INQ))
-        setr_(self._WORKQ, work)
-        setr_(INQ, inq)
-        yield
-        # extend outgoing things with utility things
-        util = getr_(self._UTILQ)
-        setr_(
-            self._OUTQ,
-            util if self._clearout else chain(util, getr_(self._OUTQ)),
-        )
-        self._clearwork()
-        # return to global context
-        self.reswap()
-
-    @contextmanager
-    def ctx4(self, **kw):
-        '''swap for four-armed context'''
-        self.swap(context=self.ctx4, **kw)._clearwork()
-        setr_ = lambda x, y: setattr(self, x, y)
-        getr_ = lambda x: getattr(self, x)
-        INQ = self._INQ
-        # extend work things with incoming things
-        work, inq = tee(getr_(INQ))
-        setr_(self._WORKQ, work)
-        setr_(INQ, inq)
-        yield
-        # extend outgoing things with utility things
-        util = getr_(self._UTILQ)
-        setr_(
-            self._OUTQ,
-            util if self._clearout else chain(util, getr_(self._OUTQ)),
-        )
-        self._clearwork()
-        # return to global context
-        self.reswap()
-
-    @contextmanager
-    def autoctx(self, **kw):
-        '''swap for auto-synchronizing context'''
-        self.swap(context=self.autoctx, **kw)._clearwork()
-        setr_ = lambda x, y: setattr(self, x, y)
-        getr_ = lambda x: getattr(self, x)
-        INQ = self._INQ
-        # extend work things with incoming things
-        work, inq = tee(getr_(INQ))
-        setr_(self._WORKQ, work)
-        setr_(INQ, inq)
-        yield
-        # extend incoming things and outgoing things with utility things
-        inq, out = tee(getr_(self._UTILQ))
-        setr_(
-            self._OUTQ,
-            out if self._clearout else chain(out, getr_(self._OUTQ)),
-        )
-        setr_(INQ, inq)
-        self._clearwork()
-        # return to global context
-        self.reswap()
-
-    def ro(self):
-        '''switch to read-only mode'''
-        with self.ctx3(outq=self._UTILVAR, savepoint=False):
-            self._xreplace(self._iterable)
-        with self.ctx1(hard=True, workq=self._UTILVAR, savepoint=False):
-            self.current_mode = self._RO
-            return self
+        delattr(self, OUTQ)
+        setattr(self, OUTQ, iter([]))
+        return self
 
 
 class AutoMixin(BaseMixin):
 
     '''auto-balancing things mixin'''
 
-    _default_context = 'autoctx'
+    _DEFAULT_CONTEXT = 'autoctx'
 
 
 class ManMixin(BaseMixin):
 
     '''manually balanced things mixin'''
 
-    _default_context = 'ctx4'
+    _DEFAULT_CONTEXT = 'ctx4'
 
 
 class EndMixin(ResultsMixin):
         wrap = self._wrapper
         out = next(out) if len(wrap(tell)) == 1 else wrap(out)
         # clear outgoing things
-        self.outclear()
+        self.clearout()
         return out
 
 

twoq/lazy/queuing.py

-# -*- coding: utf-8 -*-
-'''twoq lazy queues'''
-
-from twoq.core import SLOTS
-from twoq.mapping import MappingMixin as MapMixin
-from twoq.ordering import OrderingMixin as OrderMixin
-from twoq.reducing import ReducingMixin as ReduceMixin
-from twoq.filtering import FilteringMixin as FilterMixin
-
-from twoq.lazy.mixins import AutoResultMixin, ManResultMixin
-
-
-class autoq(AutoResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
-
-    '''auto-balancing manipulation queue'''
-
-    __slots__ = SLOTS
-
-
-class manq(ManResultMixin, FilterMixin, MapMixin, ReduceMixin, OrderMixin):
-
-    '''manually balanced manipulation queue'''
-
-    __slots__ = SLOTS
-
-
-lazyq = autoq
 from copy import deepcopy
 from threading import local
 from operator import methodcaller
-from itertools import starmap, tee, repeat
+from itertools import starmap, repeat
 
 from twoq.support import imap, ichain, items, xrange
 
         with self._context():
             return self._xtend(imap(deepcopy, self._iterable))
 
-    def padnone(self):
-        '''repeat incoming things and then `None` indefinitely'''
-        with self._context():
-            return self._iter(tee(self._iterable, repeat(None)))
-
     def range(self, start, stop=0, step=1):
         '''
         put sequence of numbers in incoming things

twoq/tests/auto/filtering.py

         test = lambda x: not x[0].startswith('__')
         value = self.qclass(
             stooges, stoog2, stoog3
-        ).tap(test).alt(isclass).wrap(tuple).extract().untap().end(),
+        ).tap(test, isclass).tuple_wrap().members().untap().end(),
         self.assertEqual(
             value,
             ((('age', 40), ('name', 'moe'), ('age', 50), ('name', 'larry'),

twoq/tests/auto/queuing.py

         initial = self.qclass(1, 2, 3, 4, 5, 6)
         self.assertListEqual(initial.peek(), [1, 2, 3, 4, 5, 6])
         self.assertEqual(len(initial), 6)
-        self.assertListEqual(initial.outsync().end(), [1, 2, 3, 4, 5, 6])
+        self.assertListEqual(initial.syncout().end(), [1, 2, 3, 4, 5, 6])
         self.assertEqual(len(initial), 0)
 
     def test_extend(self):
         self.assertEqual(
-            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().end(),
+            self.qclass().extend([1, 2, 3, 4, 5, 6]).syncout().end(),
             [1, 2, 3, 4, 5, 6],
         )
 
 
     def test_extendleft(self):
         self.assertListEqual(
-            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().end(),
+            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).syncout().end(),
             [6, 5, 4, 3, 2, 1]
         )
 
     def test_append(self):
-        autoq = self.qclass().append('foo').outsync()
+        autoq = self.qclass().append('foo').syncout()
         self.assertEqual(autoq.end(), 'foo')
 
     def test_prepend(self):
-        autoq = self.qclass().prepend('foo').outsync()
+        autoq = self.qclass().prepend('foo').syncout()
         self.assertEqual(autoq.end(), 'foo')
 
     def test_inclear(self):
-        self.assertEqual(len(list(self.qclass([1, 2, 5, 6]).inclear())), 0)
+        self.assertEqual(len(list(self.qclass([1, 2, 5, 6]).clearin())), 0)
 
     def test_outclear(self):
         self.assertEqual(
-            len(list(self.qclass([1, 2, 5, 6]).outclear().outgoing)), 0
+            len(list(self.qclass([1, 2, 5, 6]).clearout().outgoing)), 0
         )
 
     ###########################################################################
     ###########################################################################
 
     def test_insync(self):
-        q = self.qclass([1, 2, 3, 4, 5, 6]).outshift().inclear().shift()
+        q = self.qclass([1, 2, 3, 4, 5, 6]).syncout().clearin().sync()
         self.assertListEqual(list(q.incoming), list(q.outgoing))
 
     def test_outsync(self):
-        q = self.qclass([1, 2, 3, 4, 5, 6]).outshift()
+        q = self.qclass([1, 2, 3, 4, 5, 6]).syncout()
         self.assertListEqual(list(q.incoming), list(q.outgoing))
 
     ##########################################################################
 
     def test_results(self):
         self.assertListEqual(
-            list(self.qclass(1, 2, 3, 4, 5, 6).outsync().results()),
+            list(self.qclass(1, 2, 3, 4, 5, 6).syncout().results()),
             [1, 2, 3, 4, 5, 6],
         )

twoq/tests/lazy/auto/test_autoq.py

 ):
 
     def setUp(self):
-        from twoq.lazy.queuing import autoq
+        from twoq.lazy.core import autoq
         self.qclass = autoq
 
 

twoq/tests/lazy/man/test_manq.py

 ):
 
     def setUp(self):
-        from twoq.lazy.queuing import manq
+        from twoq.lazy.core import manq
         self.qclass = manq
 
 

twoq/tests/man/filtering.py

             self.qclass(
                 stooges, stoog2, stoog3
             ).tap(
-                lambda x: not x[0].startswith('__')
-            ).alt(isclass).wrap(tuple).extract().untap().sync(),
+                lambda x: not x[0].startswith('__'), isclass
+            ).tuple_wrap().members().untap().sync(),
             self.assertEqual,
             (('age', 40), ('name', 'moe'), ('age', 50), ('name', 'larry'),
             ('age', 60), ('name', 'curly'), ('stoog4', (('age', 969),

twoq/tests/man/mapping.py

         from stuf import stuf
         thing = self.qclass(
             ('a', 1), ('b', 2), ('c', 3)
-        ).reup().factory(stuf).map().shift().end()
+        ).reup().tap(stuf, factory=True).map().sync().end()
         self.assertDictEqual(thing, stuf(a=1, b=2, c=3), thing)
 
     def test_each(self):

twoq/tests/man/queuing.py

         initial = self.qclass(1, 2, 3, 4, 5, 6)
         self.assertListEqual(initial.peek(), [1, 2, 3, 4, 5, 6])
         self.assertEqual(len(initial), 6)
-        self.assertListEqual(initial.outsync().end(), [1, 2, 3, 4, 5, 6])
+        self.assertListEqual(initial.syncout().end(), [1, 2, 3, 4, 5, 6])
         self.assertEqual(len(initial), 0)
 
     def test_extend(self):
         self.assertEqual(
-            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().end(),
+            self.qclass().extend([1, 2, 3, 4, 5, 6]).syncout().end(),
             [1, 2, 3, 4, 5, 6],
         )
 
 
     def test_extendleft(self):
         self.assertEqual(
-            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().end(),
+            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).syncout().end(),
             [6, 5, 4, 3, 2, 1]
         )
 
     def test_append(self):
         self.assertEqual(
-            self.qclass().append('foo').outsync().end(), 'foo'
+            self.qclass().append('foo').syncout().end(), 'foo'
         )
 
-    def test_appendleft(self):
+    def test_prepend(self):
         self.assertEqual(
-            self.qclass().appendleft('foo').outsync().end(), 'foo'
+            self.qclass().prepend('foo').syncout().end(), 'foo'
         )
 
     def test_inclear(self):
-        self.assertEqual(len(list(self.qclass([1, 2, 5, 6]).inclear())), 0)
+        self.assertEqual(len(list(self.qclass([1, 2, 5, 6]).clearin())), 0)
 
     def test_outclear(self):
         self.assertEqual(
-            len(list(self.qclass([1, 2, 5, 6]).outclear().outgoing)), 0
+            len(list(self.qclass([1, 2, 5, 6]).clearout().outgoing)), 0
         )
 
     ###########################################################################
     ###########################################################################
 
     def test_insync(self):
-        q = self.qclass(1, 2, 3, 4, 5, 6).outshift().inclear().shift()
+        q = self.qclass(1, 2, 3, 4, 5, 6).syncout().clearin().sync()
         self.assertEqual(list(q.incoming), list(q.outgoing))
 
     def test_outsync(self):
-        q = self.qclass(1, 2, 3, 4, 5, 6).outshift()
+        q = self.qclass(1, 2, 3, 4, 5, 6).syncout()
         self.assertEqual(list(q.incoming), list(q.outgoing))
 
     ###########################################################################
 
     def test_results(self):
         self.assertEqual(
-            list(self.qclass(1, 2, 3, 4, 5, 6).outsync().results()),
+            list(self.qclass(1, 2, 3, 4, 5, 6).syncout().results()),
             [1, 2, 3, 4, 5, 6]
         )