1. Lynn Rees
  2. twoq

Commits

Lynn Rees  committed 21227f2 Merge
  • Participants
  • Parent commits ebe81d3, 9c83292
  • Branches pu
  • Tags 0.2.2

Comments (0)

Files changed (21)

File .hgignore

View file
 src/
 static/
 media/
-*.orig
-
-syntax: regexp
-^bin/fabfile\.py$
-syntax: regexp
-^graphalchemy/tests/foo$
-syntax: regexp
-^graphalchemy/tests/foo3$
-syntax: regexp
-^profile$
+*.orig

File README.rst

View file
 *twoq* chains iterators together using a double-headed input and output queue,
-that can be shifted and synced as needed.
+that can be shifted or synced as needed.
 
-*twoq* includes Python 2 <-> 3 compatibility aids and exposes some useful
-features buried in the standard library.
+*twoq* exposes some useful features buried in the standard library and 
+includes some Python 2 <-> 3 compatibility aids.
 
 Mirrored on https://github.com/kwarterthieves/twoq/

File setup.py

View file
 except ImportError:
     from distutils.core import setup
 
-install_requires = ['stuf>=0.8.6']
+install_requires = ['stuf>=0.8.7', 'distribute>=0.6.25']
 if sys.version_info[0] == 2 and sys.version_info[1] < 7:
     install_requires.extend(['ordereddict', 'unittest2'])
 
 setup(
     name='twoq',
-    version='0.2.1',
-    description='iterator chaining, underscored by two-headed queues',
+    version='0.2.2',
+    description='iterator chaining, underscored by a two-headed queue',
     long_description=open(os.path.join(os.getcwd(), 'README.rst'), 'r').read(),
     author='L. C. Rees',
     url='https://bitbucket.org/lcrees/twoq/',
     author_email='lcrees@gmail.com',
     license='MIT',
-    packages=['twoq', 'twoq.mixins', 'twoq.active'],
+    packages=['twoq', 'twoq.mixins', 'twoq.active', 'twoq.lazy'],
     test_suite='twoq.tests',
     zip_safe=False,
-    keywords='queue generator utility iterator',
+    keywords='queue generator utility iterator functional programming',
     install_requires=install_requires,
     classifiers=[
         'Development Status :: 3 - Alpha',

File twoq/__init__.py

View file
 
 __all__ = ('twoq', 'manq', 'autoq', 'port', 'syncq')
 
-__version__ = (0, 2, 1)
+__version__ = (0, 2, 2)

File twoq/active/mixins.py

View file
 # -*- coding: utf-8 -*-
 '''active twoq mixins'''
 
+from threading import local
 from collections import deque
 from bisect import bisect_right
 
         ## incoming things ####################################################
         #######################################################################
         # incoming things right append
-        self._inappend = self.incoming.append
+        self._inappend = self.__inappend = self.incoming.append
         # incoming things left append
-        self._inappendleft = self.incoming.appendleft
+        self._inappendleft = self.__inappendleft = self.incoming.appendleft
         # incoming things clear
-        self._inclear = self.incoming.clear
+        self._inclear = self.__inclear = self.incoming.clear
         # incoming things right extend
-        self._inextend = self.incoming.extend
+        self._inextend = self.__inextend = self.incoming.extend
         # incoming things left extend
-        self._inextendleft = self.incoming.extendleft
+        self._inextendleft = self.__inextendleft = self.incoming.extendleft
         #######################################################################
         ## outgoing things ####################################################
         #######################################################################
         # outgoing things right append
-        self._outappend = self.outgoing.append
+        self._outappend = self.__outappend = self.outgoing.append
         # outgoing things right extend
-        self._outextend = self.outgoing.extend
+        self._outextend = self.__outextend = self.outgoing.extend
         # outgoing things clear
-        self._outclear = self.outgoing.clear
+        self._outclear = self.__outclear = self.outgoing.clear
         # outgoing things right pop
-        self.pop = self.outgoing.pop
+        self.pop = self.__pop = self.outgoing.pop
         # outgoing things left pop
-        self.popleft = self.outgoing.popleft
+        self.popleft = self.__popleft = self.outgoing.popleft
 
     ###########################################################################
     ## queue information ######################################################
     def clear(self):
         '''clear every thing'''
         self.detap()
-        self._outclear()
-        self._inclear()
+        self.__outclear()
+        self.__inclear()
         return self
 
     _oclear = clear
 
     def inclear(self):
         '''clear incoming things'''
-        self._inclear()
+        self.__inclear()
         return self
 
     _oiclear = inclear
 
     def outclear(self):
         '''clear outgoing things'''
-        self._oclear()
+        self.__outclear()
         return self
 
     _ooutclear = outclear
 
         @param thing: some thing
         '''
-        self._inappend(thing)
+        self.__inappend(thing)
         return self
 
     _oappend = append
 
         @param thing: some thing
         '''
-        self._inappendleft(thing)
+        self.__inappendleft(thing)
         return self
 
     _oappendleft = appendleft
 
         @param thing: some things
         '''
-        self._outextend(things)
+        self.__outextend(things)
         return self
 
     def extend(self, things):
 
         @param thing: some things
         '''
-        self._inextend(things)
+        self.__inextend(things)
         return self
 
     _oextend = extend
 
         @param thing: some things
         '''
-        self._inextendleft(things)
+        self.__inextendleft(things)
         return self
 
     _oextendleft = extendleft
 
     def shift(self):
         '''shift outgoing things to incoming things'''
-        self._inextend(self.outgoing)
+        self.__inextend(self.outgoing)
         return self
 
     _oshift = shift
         shift outgoing things to incoming things, clearing incoming things
         '''
         # clear incoming things
-        self._inclear()
+        self.__inclear()
         # extend incoming things with outgoing things
-        self._inextend(self.outgoing)
+        self.__inextend(self.outgoing)
         return self
 
     _osync = sync
     def outshift(self):
         '''shift incoming things to outgoing things'''
         # extend incoming things with outgoing things
-        self._outextend(self.incoming)
+        self.__outextend(self.incoming)
         return self
 
     _outshift = outshift
         shift incoming things to outgoing things, clearing outgoing things
         '''
         # clear incoming things
-        self._outclear()
+        self.__outclear()
         # extend incoming things with outgoing things
-        self._outextend(self.incoming)
+        self.__outextend(self.incoming)
         return self
 
     _outsync = outsync
         self._spopleft = self._scratch.popleft
 
 
-class ResultQMixin(BaseQMixin):
+class ResultQMixin(local):
 
     def end(self):
         '''return outgoing things and clear out all things'''
         self.clear()
         return results
 
-    _ofinal = end
+    _oend = end
 
     def results(self):
         '''yield outgoing things and clear outgoing things'''
-        for thing in iterexcept(self.outgoing.popleft, IndexError):
+        for thing in iterexcept(self.popleft, IndexError):
             yield thing
 
     _oresults = results
         return AutoContext(self)
 
 
-class AutoResultMixin(AutoQMixin, ResultQMixin):
+class AutoResultMixin(AutoQMixin, BaseQMixin, ResultQMixin):
 
     '''auto balancing manipulation queue mixin'''
 
         return ManContext(self)
 
 
-class ManResultMixin(ManQMixin, ResultQMixin):
+class ManResultMixin(ManQMixin, BaseQMixin, ResultQMixin):
 
     '''manually balanced manipulation queue mixin'''
 
         return SyncContext(self)
 
 
-class SyncResultMixin(SyncQMixin, ResultQMixin):
+class SyncResultMixin(SyncQMixin, BaseQMixin, ResultQMixin):
 
     '''synchronized manipulation queue'''

File twoq/lazy/mixins.py

View file
 
         @param thing: some things
         '''
-        self.outgoing = deque(self.outgoing)
-        self.outgoing.extend(things)
-        self.outgoing = iter(self.outgoing)
+        outgoing = deque(self.outgoing)
+        outgoing.extend(things)
+        self.outgoing = iter(outgoing)
         return self
 
+    _ooutextend = outextend
+
     def _sxtend(self, things):
         self._scratch = deque(things)
 

File twoq/mixins/filtering.py

View file
 
 from inspect import getmro
 from threading import local
-from itertools import tee, chain, islice
+from itertools import tee, islice
 from functools import partial, reduce as ireduce
 from operator import attrgetter, itemgetter, truth
 
-from stuf.utils import getcls
-
-from twoq import support as ct
+from stuf.six import PY3
+from stuf.utils import getcls, ifilter, imap
+from twoq.support import chain_iter, filterfalse
 
 __all__ = (
     'FilterMixin', 'CollectMixin', 'SetMixin', 'SliceMixin', 'FilteringMixin',
 )
-chain_iter = chain.from_iterable
-_filter = ct.filter
-_filterfalse = ct.filterfalse
-_map = ct.map
-_PY3 = ct.port.PY3
 
 ###############################################################################
 ## filtering subroutines ######################################################
     @param call: "Truth" filter
     @param iterable: an iterable
     '''
-    for thing in _filter(call, iterable):
+    for thing in ifilter(call, iterable):
         yield thing
         break
 
     @param iterable: an iterable
     '''
     _members = members
-    for i in ct.filter(call, _members(iterable)):
+    for i in ifilter(call, _members(iterable)):
         yield i
 
 
     seen = set()
     seen_add = seen.add
     if key is None:
-        for element in _filterfalse(seen.__contains__, iterable):
+        for element in filterfalse(seen.__contains__, iterable):
             seen_add(element)
             yield element
     else:
         '''collect object members from incoming things and their bases'''
         _mz = partial(mfilter, self._call)
         with self._sync as sync:
-            if _PY3:
+            if PY3:
                 def _memfilters(thing, mz=_mz, gc=getcls, ci=chain_iter):
                     t = lambda x: not x[0].startswith('mro')
-                    return _filter(
-                        t, ci(_map(mz, ci([getmro((gc(thing))), [thing]])))
+                    return ifilter(
+                        t, ci(imap(mz, ci([getmro((gc(thing))), [thing]])))
                     )
             else:
                 def _memfilters(thing, mz=_mz, gc=getcls, ci=chain_iter):
-                    return ci(_map(mz, ci([getmro((gc(thing))), [thing]])))
-            sync(chain_iter(_map(_memfilters, sync.iterable)))
+                    return ci(imap(mz, ci([getmro((gc(thing))), [thing]])))
+            sync(chain_iter(imap(_memfilters, sync.iterable)))
         return self
 
     _odeepmembers = deepmembers
         call = self._call
         _mz = partial(mfilter, call)
         with self._sync as sync:
-            sync(chain_iter(_map(_mz, sync.iterable)))
+            sync(chain_iter(imap(_mz, sync.iterable)))
         return self
 
     _omembers = members
     def compact(self):
         '''strip "untrue" things from incoming things'''
         with self._sync as sync:
-            sync.iter(_filter(truth, sync.iterable))
+            sync.iter(ifilter(truth, sync.iterable))
         return self
 
     _ocompact = compact
         '''incoming things for which call is `True`'''
         call = self._call
         with self._sync as sync:
-            sync(_filter(call, sync.iterable))
+            sync(ifilter(call, sync.iterable))
         return self
 
     _ofilter = filter
         with self._sync as sync:
             falsy, truey = tee(sync.iterable)
             sync(iter(
-                [list(_filterfalse(call, falsy)), list(_filter(call, truey))]
+                [list(filterfalse(call, falsy)), list(ifilter(call, truey))]
             ))
         return self
 
         '''incoming things for which call is `False`'''
         call = self._call
         with self._sync as sync:
-            sync(_filterfalse(call, sync.iterable))
+            sync(filterfalse(call, sync.iterable))
         return self
 
     _oreject = reject
     def without(self, *things):
         '''strip things from incoming things'''
         with self._sync as sync:
-            sync(_filterfalse(lambda x: x in things, sync.iterable))
+            sync(filterfalse(lambda x: x in things, sync.iterable))
         return self
 
     _owithout = without

File twoq/mixins/mapping.py

View file
 from itertools import starmap, chain, repeat
 
 from stuf.six import items
-from twoq import support as ct
+from stuf.utils import imap
+from twoq.support import range
+from twoq.support import chain_iter
 
 __all__ = (
     'DelayMixin', 'CopyMixin', 'RepeatMixin', 'MapMixin', 'MappingMixin',
 )
-chain_iter = chain.from_iterable
-_map = ct.map
-_xrange = ct.xrange
 
 ###############################################################################
 ## mapping subroutines ########################################################
             caller=methodcaller(name, *self._args, **self._kw),
         )
         with self._sync as sync:
-            sync(_map(_call, sync.iterable))
+            sync(imap(_call, sync.iterable))
         return self
 
     _odelay_invoke = delay_invoke
         '''
         _call = partial(delay_map, wait=wait, caller=self._call)
         with self._sync as sync:
-            sync(_map(_call, sync.iterable))
+            sync(imap(_call, sync.iterable))
         return self
 
-    _odelay_map = delay_map
+    _odelayimap = delay_map
 
 
 class CopyMixin(local):
     def copy(self):
         '''copy each incoming thing'''
         with self._sync as sync:
-            sync(_map(copy, sync.iterable))
+            sync(imap(copy, sync.iterable))
         return self
 
     _ocopy = copy
     def deepcopy(self):
         '''copy each incoming thing deeply'''
         with self._sync as sync:
-            sync(_map(deepcopy, sync.iterable))
+            sync(imap(deepcopy, sync.iterable))
         return self
 
     _odeepcopy = deepcopy
         '''
         with self._sync as sync:
             if stop:
-                sync(_xrange(start, stop, step))
+                sync(range(start, stop, step))
             else:
-                sync(_xrange(start))
+                sync(range(start))
         return self
 
     _orange = range
             invoke, caller=methodcaller(name, *self._args, **self._kw),
         )
         with self._sync as sync:
-            sync(_map(_call, sync.iterable))
+            sync(imap(_call, sync.iterable))
         return self
 
     _oinvoke = invoke
         '''invoke call on each mapping to get key, value pairs'''
         call = self._call
         with self._sync as sync:
-            sync(starmap(call, chain_iter(_map(items, sync.iterable))))
+            sync(starmap(call, chain_iter(imap(items, sync.iterable))))
         return self
 
     _ostarmap = items
         '''invoke call on each incoming thing'''
         call = self._call
         with self._sync as sync:
-            sync(_map(call, sync.iterable))
+            sync(imap(call, sync.iterable))
         return self
 
     _omap = map

File twoq/mixins/ordering.py

View file
 from itertools import groupby
 from random import choice, shuffle, sample
 
-from twoq import support as ct
+from stuf.utils import imap
+from twoq.support import zip_longest
 
 __all__ = ('OrderMixin', 'RandomMixin', 'OrderingMixin')
-_map = ct.map
-_zip_longest = ct.zip_longest
 
 
 class RandomMixin(local):
         call = self._call
         with self._sync as sync:
             if call is None:
-                sync(_map(
+                sync(imap(
                     lambda x: [x[0], list(x[1])], groupby(sync.iterable)
                 ))
             else:
-                sync(_map(
+                sync(imap(
                     lambda x: [x[0], list(x[1])], groupby(sync.iterable, call),
                 ))
         return self
         @param fill: fill thing (default: None)
         '''
         with self._sync as sync:
-            sync(_zip_longest(fillvalue=fill, *[iter(sync.iterable)] * n))
+            sync(zip_longest(fillvalue=fill, *[iter(sync.iterable)] * n))
         return self
 
     _ogrouper = grouper

File twoq/mixins/reducing.py

View file
 from itertools import cycle, tee, islice
 from functools import partial, reduce as ireduce
 
-from twoq import support as ct
+from stuf.utils import imap
+from twoq.support import Counter, isstring, zip
 
 __all__ = ('MathMixin', 'TruthMixin', 'ReduceMixin', 'ReducingMixin')
-Counter = ct.Counter
-_zip = zip
-_map = ct.map
 
 ###############################################################################
 ## reducing subroutines #######################################################
 
     @param iterable: an iterable
     '''
-    isstring = ct.port.isstring
+    _isstring = isstring
     _Iterable = Iterable
     _smash = smash
     for i in iterable:
-        if isinstance(i, _Iterable) and not isstring(i):
+        if isinstance(i, _Iterable) and not _isstring(i):
             for j in _smash(i):
                 yield j
         else:
         '''if `all` incoming things are `True`'''
         call = self._call
         with self._sync as sync:
-            sync.append(all(_map(call, sync.iterable)))
+            sync.append(all(imap(call, sync.iterable)))
         return self
 
     _oall = all
         '''if `any` incoming things are `True`'''
         call = self._call
         with self._sync as sync:
-            sync.append(any(_map(call, sync.iterable)))
+            sync.append(any(imap(call, sync.iterable)))
         return self
 
     _oany = any
         '''how many times call is `True` for incoming things'''
         call = self._call
         with self._sync as sync:
-            sync.append(sum(_map(call, sync.iterable)))
+            sync.append(sum(imap(call, sync.iterable)))
         return self
 
     _oquantify = quantify
         with self._sync as sync:
             a, b = tee(sync.iterable)
             next(b, None)
-            sync(_zip(a, b))
+            sync(zip(a, b))
         return self
 
     _opairwise = pairwise
         position
         '''
         with self._sync as sync:
-            sync(_zip(*sync.iterable))
+            sync(zip(*sync.iterable))
         return self
 
     _ozip = zip

File twoq/support.py

View file
 # -*- coding: utf-8 -*-
 '''twoq support'''
 
+from itertools import chain
+
 from stuf import six
 # pylint: disable-msg=f0401,w0611
 from stuf.six.moves import (
 
 __all__ = ['port']
 items = six.items
+chain_iter = chain.from_iterable
+range = xrange
 
 
 class port(object):
 
 
 isstring = port.isstring
+isunicode = port.isunicode
 
 
 import sys
     import heapq
     from collections import Mapping
     from operator import itemgetter
-    from itertools import chain, repeat, starmap
+    from itertools import repeat, starmap
 
     class Counter(dict):
 

File twoq/tests/mixins/auto/filtering.py

View file
 # -*- coding: utf-8 -*-
-'''auto filtering test mixins'''
+'''auto filtering call chain test mixins'''
 
 from inspect import ismodule
 
 class ASliceQMixin(object):
 
     def test_first(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).first().value(), 5,
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).first().end(), 5)
 
     def test_nth(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).nth(2).value(), 3,
-        )
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).nth(10, 11).value(), 11,
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).nth(2).end(), 3)
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).nth(10, 11).end(), 11)
 
     def test_last(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).last().value(), 1,
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).last().end(), 1)
 
     def test_initial(self):
         self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).initial().value(), [5, 4, 3, 2]
+            self.qclass(5, 4, 3, 2, 1).initial().end(), [5, 4, 3, 2]
         )
 
     def test_rest(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).rest().value(), [4, 3, 2, 1]
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).rest().end(), [4, 3, 2, 1])
 
     def test_take(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).take(2).value(), [5, 4]
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).take(2).end(), [5, 4])
 
     def test_takeback(self):
-        self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).snatch(2).value(), [2, 1]
-        )
+        self.assertEqual(self.qclass(5, 4, 3, 2, 1).snatch(2).end(), [2, 1])
 
 
 class ACollectQMixin(object):
         self.assertEqual(
             self.qclass(
                 stooges, stoog2, stoog3
-            ).tap(test).members().detap().value(),
+            ).tap(test).members().detap().end(),
             [('age', 40), ('name', 'moe'), ('age', 50), ('name', 'larry'),
             ('age', 60), ('name', 'curly')],
         )
         self.assertSequenceEqual(
             self.qclass(
                 stooges, stoog2, stoog3
-            ).tap(test).deepmembers().sync().value(),
+            ).tap(test).deepmembers().sync().end(),
             [('age', 40), ('boo', stooges.boo), ('foo', stooges.foo),
             ('name', 'moe'), ('age', 50), ('boo', stoog2.boo),
             ('foo', stoog2.foo), ('name', 'larry'), ('age', 60),
         self.assertSequenceEqual(
             self.qclass(
                 stooges, stoog2, stoog3
-            ).tap(test).deepmembers().sync().value(),
+            ).tap(test).deepmembers().sync().end(),
             [('boo', stooges.boo), ('foo', stooges.foo), ('boo', stoog2.boo),
             ('foo', stoog2.foo), ('boo', stoog3.boo), ('foo', stoog3.foo)],
         )
             stuf(name='curly', age=60)
         ]
         self.assertEqual(
-            self.qclass(*stooges).pick('name').value(),
+            self.qclass(*stooges).pick('name').end(),
             ['moe', 'larry', 'curly'],
         )
         self.assertEqual(
-            self.qclass(*stooges).pick('name', 'age').value(),
+            self.qclass(*stooges).pick('name', 'age').end(),
             [('moe', 40), ('larry', 50), ('curly', 60)],
         )
         self.assertEqual(
-            self.qclass(*stooges).pick('place').value(), [],
+            self.qclass(*stooges).pick('place').end(), [],
         )
 
     def test_pluck(self):
             stuf(name='curly', age=60)
         ]
         self.assertEqual(
-            self.qclass(*stooges).pluck('name').value(),
+            self.qclass(*stooges).pluck('name').end(), 
             ['moe', 'larry', 'curly'],
         )
         self.assertEqual(
-            self.qclass(*stooges).pluck('name', 'age').value(),
+            self.qclass(*stooges).pluck('name', 'age').end(),
             [('moe', 40), ('larry', 50), ('curly', 60)],
         )
         stooges = [['moe', 40], ['larry', 50], ['curly', 60]]
         self.assertEqual(
-            self.qclass(*stooges).pluck(0).value(),
-            ['moe', 'larry', 'curly'],
+            self.qclass(*stooges).pluck(0).end(), ['moe', 'larry', 'curly'],
         )
-        self.assertEqual(
-            self.qclass(*stooges).pluck(1).value(),
-            [40, 50, 60],
-        )
-        self.assertEqual(
-            self.qclass(*stooges).pluck('place').value(), [],
-        )
+        self.assertEqual(self.qclass(*stooges).pluck(1).end(), [40, 50, 60])
+        self.assertEqual(self.qclass(*stooges).pluck('place').end(), [])
 
 
 class ASetQMixin(object):
 
     def test_difference(self):
         self.assertEqual(
-            self.qclass([1, 2, 3, 4, 5], [5, 2, 10]).difference().value(),
+            self.qclass([1, 2, 3, 4, 5], [5, 2, 10]).difference().end(),
             [1, 3, 4],
         )
 
     def test_disjointed(self):
-        self.assertTrue(
-            self.qclass([1, 2, 3], [5, 4, 10]).disjointed().value()
-        )
-        self.assertFalse(
-            self.qclass([1, 2, 3], [5, 2, 10]).disjointed().value()
-        )
+        self.assertTrue(self.qclass([1, 2, 3], [5, 4, 10]).disjointed().end())
+        self.assertFalse(self.qclass([1, 2, 3], [5, 2, 10]).disjointed().end())
 
     def test_intersection(self):
         self.assertEqual(
             self.qclass(
                 [1, 2, 3], [101, 2, 1, 10], [2, 1]
-            ).intersection().value(), [1, 2],
+            ).intersection().end(), [1, 2],
         )
 
     def test_union(self):
         self.assertEqual(
-            self.qclass([1, 2, 3], [101, 2, 1, 10], [2, 1]).union().value(),
+            self.qclass([1, 2, 3], [101, 2, 1, 10], [2, 1]).union().end(),
             [1, 10, 3, 2, 101],
         )
 
     def test_unique(self):
         self.assertEqual(
-            self.qclass(1, 2, 1, 3, 1, 4).unique().value(),
-            [1, 2, 3, 4],
+            self.qclass(1, 2, 1, 3, 1, 4).unique().end(), [1, 2, 3, 4],
         )
         self.assertEqual(
-            self.qclass(1, 2, 1, 3, 1, 4).tap(round).unique().value(),
+            self.qclass(1, 2, 1, 3, 1, 4).tap(round).unique().end(),
             [1, 2, 3, 4],
         )
 
         self.assertEqual(
             self.qclass(1, 2, 3, 4, 5, 6).tap(
                 lambda x: x % 2 == 0
-            ).filter().value(), [2, 4, 6]
+            ).filter().end(), [2, 4, 6]
         )
 
     def test_find(self):
         self.assertEqual(
             self.qclass(1, 2, 3, 4, 5, 6).tap(
                 lambda x: x % 2 == 0
-            ).find().value(), 2,
+            ).find().end(), 2,
         )
 
     def test_reject(self):
         self.assertEqual(
             self.qclass(1, 2, 3, 4, 5, 6).tap(
                 lambda x: x % 2 == 0
-            ).reject().value(), [1, 3, 5]
+            ).reject().end(), [1, 3, 5]
         )
 
     def test_partition(self):
         self.assertEqual(
             self.qclass(1, 2, 3, 4, 5, 6).tap(
                 lambda x: x % 2 == 0
-            ).partition().value(), [[1, 3, 5], [2, 4, 6]]
+            ).partition().end(), [[1, 3, 5], [2, 4, 6]]
         )
 
     def test_compact(self):
         self.assertEqual(
-            self.qclass(0, 1, False, 2, '', 3).compact().value(),
-            [1, 2, 3],
+            self.qclass(0, 1, False, 2, '', 3).compact().end(), [1, 2, 3],
         )
 
     def test_without(self):
         self.assertEqual(
-            self.qclass(1, 2, 1, 0, 3, 1, 4).without(0, 1).value(),
-            [2, 3, 4],
+            self.qclass(1, 2, 1, 0, 3, 1, 4).without(0, 1).end(), [2, 3, 4],
         )
 
 __all__ = sorted(name for name, obj in port.items(locals()) if not any([

File twoq/tests/mixins/auto/mapping.py

View file
 # -*- coding: utf-8 -*-
-'''auto mapping test mixins'''
+'''auto mapping call chain test mixins'''
 
 from inspect import ismodule
 
 
     def test_copy(self):
         testlist = [[1, 2, 3], [4, 5, 6]]
-        newlist = self.qclass(testlist).copy().value()
+        newlist = self.qclass(testlist).copy().end()
         self.assertFalse(newlist is testlist)
         self.assertListEqual(newlist, testlist)
         self.assertTrue(newlist[0] is testlist[0])
 
     def test_deepcopy(self):
         testlist = [[1, [2, 3]], [4, [5, 6]]]
-        newlist = self.qclass(testlist).deepcopy().value()
+        newlist = self.qclass(testlist).deepcopy().end()
         self.assertFalse(newlist is testlist)
         self.assertListEqual(newlist, testlist)
         self.assertFalse(newlist[0] is testlist[0])
 class ARepeatQMixin(object):
 
     def test_range(self):
-        self.assertEqual(self.qclass().range(3).value(), [0, 1, 2])
-        self.assertEqual(self.qclass().range(1, 3).value(), [1, 2])
-        self.assertEqual(self.qclass().range(1, 3, 2).value(), 1)
+        self.assertEqual(self.qclass().range(3).end(), [0, 1, 2])
+        self.assertEqual(self.qclass().range(1, 3).end(), [1, 2])
+        self.assertEqual(self.qclass().range(1, 3, 2).end(), 1)
 
     def test_repeat(self):
         self.assertEqual(
-            self.qclass(40, 50, 60).repeat(3).value(),
+            self.qclass(40, 50, 60).repeat(3).end(),
             [(40, 50, 60), (40, 50, 60), (40, 50, 60)],
         )
 
         def test(*args):
             return list(args)
         self.assertEqual(
-            self.qclass(40, 50, 60).tap(test).times(3).value(),
+            self.qclass(40, 50, 60).tap(test).times(3).end(),
             [[40, 50, 60], [40, 50, 60], [40, 50, 60]],
         )
 
         self.assertEqual(
             self.qclass(
                 ((1, 2), {'a': 2}), ((2, 3), {'a': 2}), ((3, 4), {'a': 2})
-            ).tap(test).delay_each(0.1).value(),
+            ).tap(test).delay_each(0.1).end(),
             [6, 10, 14],
         )
 
     def test_delay_map(self):
         self.assertEqual(
-            self.qclass(1, 2, 3).tap(lambda x: x * 3).delay_map(0.1).value(),
+            self.qclass(1, 2, 3).tap(lambda x: x * 3).delay_map(0.1).end(),
             [3, 6, 9],
         )
 
     def test_delay_invoke(self):
         self.assertEqual(
             self.qclass([5, 1, 7], [3, 2, 1])
-            .args(1).delay_invoke('index', 0.1).value(),
+            .args(1).delay_invoke('index', 0.1).end(),
             [1, 2],
         )
         self.assertEqual(
-            self.qclass([5, 1, 7], [3, 2, 1])
-            .delay_invoke('sort', 0.1).value(),
+            self.qclass([5, 1, 7], [3, 2, 1]).delay_invoke('sort', 0.1).end(),
             [[1, 5, 7], [1, 2, 3]],
         )
 
         self.assertDictEqual(
             self.qclass(
                 ('a', 1), ('b', 2), ('c', 3)
-            ).reup().wrap(stuf).map().value(),
+            ).reup().wrap(stuf).map().end(),
             stuf(a=1, b=2, c=3),
         )
 
         self.assertEqual(
             self.qclass(
                 ((1, 2), {'a': 2}), ((2, 3), {'a': 2}), ((3, 4), {'a': 2})
-            ).tap(test).each().value(),
+            ).tap(test).each().end(),
             [6, 10, 14],
         )
 
     def test_map(self):
         self.assertEqual(
-            self.qclass(1, 2, 3).tap(lambda x: x * 3).map().value(), [3, 6, 9],
+            self.qclass(1, 2, 3).tap(lambda x: x * 3).map().end(), [3, 6, 9],
         )
 
     def test_starmap(self):
         self.assertEqual(
             self.qclass(
                 (1, 2), (2, 3), (3, 4)
-            ).tap(lambda x, y: x * y).starmap().value(), [2, 6, 12],
+            ).tap(lambda x, y: x * y).starmap().end(), [2, 6, 12],
         )
 
     def test_items(self):
         self.assertEqual(
             self.qclass(
                 dict([(1, 2), (2, 3), (3, 4)]), dict([(1, 2), (2, 3), (3, 4)])
-            ).tap(lambda x, y: x * y).items().value(), [2, 6, 12, 2, 6, 12],
+            ).tap(lambda x, y: x * y).items().end(), [2, 6, 12, 2, 6, 12],
         )
 
     def test_invoke(self):
         self.assertEqual(
-            self.qclass([5, 1, 7], [3, 2, 1]).args(1).invoke('index').value(),
+            self.qclass([5, 1, 7], [3, 2, 1]).args(1).invoke('index').end(),
             [1, 2],
         )
         self.assertEqual(
-            self.qclass([5, 1, 7], [3, 2, 1]).invoke('sort').value(),
+            self.qclass([5, 1, 7], [3, 2, 1]).invoke('sort').end(),
             [[1, 5, 7], [1, 2, 3]],
         )
 

File twoq/tests/mixins/auto/ordering.py

View file
 # -*- coding: utf-8 -*-
-'''auto ordering test mixins'''
+'''auto ordering call chain test mixins'''
 
 from inspect import ismodule
 
 class ARandomQMixin(object):
 
     def test_choice(self):
-        self.assertEqual(
-            len(self.qclass(1, 2, 3, 4, 5, 6).choice()), 1,
-        )
+        self.assertEqual(len(list(self.qclass(1, 2, 3, 4, 5, 6).choice())), 1)
 
     def test_sample(self):
-        self.assertEqual(
-            len(self.qclass(1, 2, 3, 4, 5, 6).sample(3).value()), 3,
-        )
+        self.assertEqual(len(self.qclass(1, 2, 3, 4, 5, 6).sample(3).end()), 3)
 
     def test_shuffle(self):
         self.assertEqual(
     def test_group(self,):
         from math import floor
         self.assertEqual(
-        self.qclass(1.3, 2.1, 2.4).tap(lambda x: floor(x)).group().value(),
+        self.qclass(1.3, 2.1, 2.4).tap(lambda x: floor(x)).group().end(),
             [[1.0, [1.3]], [2.0, [2.1, 2.4]]]
         )
         self.assertEqual(
-            self.qclass(1.3, 2.1, 2.4).group().value(),
+            self.qclass(1.3, 2.1, 2.4).group().end(),
             [[1.3, [1.3]], [2.1, [2.1]], [2.4, [2.4]]],
         )
 
         self.assertEqual(
             self.qclass(
                 'moe', 'larry', 'curly', 30, 40, 50, True
-            ).grouper(2, 'x').value(),
+            ).grouper(2, 'x').end(),
              [('moe', 'larry'), ('curly', 30), (40, 50), (True, 'x')]
         )
 
     def test_reversed(self):
         self.assertEqual(
-            self.qclass(5, 4, 3, 2, 1).reverse().value(), [1, 2, 3, 4, 5],
+            self.qclass(5, 4, 3, 2, 1).reverse().end(), [1, 2, 3, 4, 5],
         )
 
     def test_sort(self):
         self.assertEqual(
             self.qclass(1, 2, 3, 4, 5, 6).tap(
                 lambda x: sin(x)
-            ).sort().value(),
+            ).sort().end(),
             [5, 4, 6, 3, 1, 2],
         )
         self.assertEqual(
-            self.qclass(4, 6, 65, 3, 63, 2, 4).sort().value(),
+            self.qclass(4, 6, 65, 3, 63, 2, 4).sort().end(),
             [2, 3, 4, 4, 6, 63, 65],
         )
 

File twoq/tests/mixins/auto/queuing.py

View file
 # -*- coding: utf-8 -*-
-'''auto queuing test mixins'''
+'''auto queuing call chain test mixins'''
 
 
 class AQMixin(object):
     def test_delitem(self):
         q = self.qclass(1, 2, 3, 4, 5, 6)
         del q[2]
-        self.assertEqual(q.outsync().value(), [1, 2, 4, 5, 6])
+        self.assertEqual(q.outsync().end(), [1, 2, 4, 5, 6])
 
     def test_remove(self):
         self.assertEqual(
-            self.qclass(1, 2, 3, 4, 5, 6).remove(5).outsync().value(),
+            self.qclass(1, 2, 3, 4, 5, 6).remove(5).outsync().end(),
             [1, 2, 3, 4, 6],
         )
 
     def test_insert(self):
         q = self.qclass(1, 2, 3, 4, 5, 6)
         q.insert(2, 10)
-        self.assertEqual(q.outsync().value(), [1, 2, 10, 3, 4, 5, 6])
+        self.assertEqual(q.outsync().end(), [1, 2, 10, 3, 4, 5, 6])
 
     def test_extend(self):
         self.assertEqual(
-            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().value(),
+            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().end(),
             [1, 2, 3, 4, 5, 6],
         )
 
     def test_extendleft(self):
         self.assertEqual(
-            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().value(),
+            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().end(),
             [6, 5, 4, 3, 2, 1]
         )
 
     def test_append(self):
         autoq = self.qclass().append('foo').outsync()
-        self.assertEqual(autoq.value(), 'foo')
+        self.assertEqual(autoq.end(), 'foo')
 
     def test_appendleft(self):
         autoq = self.qclass().appendleft('foo').outsync()
-        self.assertEqual(autoq.value(), 'foo')
+        self.assertEqual(autoq.end(), 'foo')
 
     def test_inclear(self):
         self.assertEqual(len(list(self.qclass([1, 2, 5, 6]).inclear())), 0)

File twoq/tests/mixins/auto/reducing.py

View file
 class AMathQMixin(object):
 
     def test_max(self):
-        self.assertEqual(self.qclass(1, 2, 4).max().value(), 4)
+        self.assertEqual(self.qclass(1, 2, 4).max().end(), 4)
         from stuf import stuf
         stooges = [
             stuf(name='moe', age=40),
             stuf(name='curly', age=60),
         ]
         self.assertEqual(
-            stuf(self.qclass(*stooges).tap(lambda x: x.age).max().value()),
+            stuf(self.qclass(*stooges).tap(lambda x: x.age).max().end()),
             stuf(name='curly', age=60),
         )
 
     def test_min(self):
-        self.assertEqual(self.qclass(10, 5, 100, 2, 1000).min().value(), 2)
+        self.assertEqual(self.qclass(10, 5, 100, 2, 1000).min().end(), 2)
         self.assertEqual(
-            self.qclass(10, 5, 100, 2, 1000).tap(lambda x: x).min().value(), 2,
+            self.qclass(10, 5, 100, 2, 1000).tap(lambda x: x).min().end(), 2,
         )
 
     def test_minmax(self):
-        self.assertEqual(self.qclass(1, 2, 4).minmax().value(), [1, 4])
+        self.assertEqual(self.qclass(1, 2, 4).minmax().end(), [1, 4])
         self.assertEqual(
-            self.qclass(10, 5, 100, 2, 1000).minmax().value(), [2, 1000],
+            self.qclass(10, 5, 100, 2, 1000).minmax().end(), [2, 1000],
         )
 
     def test_median(self):
-        self.assertEqual(self.qclass(4, 5, 7, 2, 1).median().value(), 4)
-        self.assertEqual(self.qclass(4, 5, 7, 2, 1, 8).median().value(), 4.5)
+        self.assertEqual(self.qclass(4, 5, 7, 2, 1).median().end(), 4)
+        self.assertEqual(self.qclass(4, 5, 7, 2, 1, 8).median().end(), 4.5)
 
     def test_mode(self):
         self.assertEqual(
-            self.qclass(11, 3, 5, 11, 7, 3, 11).mode().value(), 11,
+            self.qclass(11, 3, 5, 11, 7, 3, 11).mode().end(), 11,
         )
 
     def test_uncommon(self):
         self.assertEqual(
-            self.qclass(11, 3, 5, 11, 7, 3, 11).uncommon().value(), 7,
+            self.qclass(11, 3, 5, 11, 7, 3, 11).uncommon().end(), 7,
         )
 
     def test_frequency(self):
         self.assertEqual(
-            self.qclass(11, 3, 5, 11, 7, 3, 11).frequency().value(),
+            self.qclass(11, 3, 5, 11, 7, 3, 11).frequency().end(),
             [(11, 3), (3, 2), (5, 1), (7, 1)]
         )
 
     def test_statrange(self):
-        self.assertEqual(self.qclass(3, 5, 7, 3, 11).statrange().value(), 8)
+        self.assertEqual(self.qclass(3, 5, 7, 3, 11).statrange().end(), 8)
 
     def test_sum(self):
-        self.assertEqual(self.qclass(1, 2, 3).sum().value(), 6)
-        self.assertEqual(self.qclass(1, 2, 3).sum(1).value(), 7)
+        self.assertEqual(self.qclass(1, 2, 3).sum().end(), 6)
+        self.assertEqual(self.qclass(1, 2, 3).sum(1).end(), 7)
 
     def test_fsum(self):
         self.assertEqual(
-            self.qclass(.1, .1, .1, .1, .1, .1, .1, .1, .1, .1).fsum().value(),
+            self.qclass(.1, .1, .1, .1, .1, .1, .1, .1, .1, .1).fsum().end(),
             1.0,
         )
 
     def test_average(self):
         self.assertEqual(
-            self.qclass(10, 40, 45).average().value(), 31.666666666666668,
+            self.qclass(10, 40, 45).average().end(), 31.666666666666668,
         )
 
 
 
     def test_all(self):
         self.assertFalse(
-            self.qclass(True, 1, None, 'yes').tap(bool).all().value()
+            self.qclass(True, 1, None, 'yes').tap(bool).all().end()
         )
 
     def test_any(self):
         self.assertTrue(
-            self.qclass(None, 0, 'yes', False).tap(bool).any().value()
+            self.qclass(None, 0, 'yes', False).tap(bool).any().end()
         )
 
     def test_include(self):
-        self.assertTrue(self.qclass(1, 2, 3).contains(3).value())
+        self.assertTrue(self.qclass(1, 2, 3).contains(3).end())
 
     def test_quantify(self):
         self.assertEqual(
-            self.qclass(True, 1, None, 'yes').tap(bool).quantify().value(), 3,
+            self.qclass(True, 1, None, 'yes').tap(bool).quantify().end(), 3,
         )
         self.assertEqual(
-            self.qclass(None, 0, 'yes', False).tap(bool).quantify().value(), 1,
+            self.qclass(None, 0, 'yes', False).tap(bool).quantify().end(), 1,
         )
 
 
 
     def test_smash(self):
         self.assertEqual(
-            self.qclass([[1, [2], [3, [[4]]]]]).smash().value(), [1, 2, 3, 4],
+            self.qclass([[1, [2], [3, [[4]]]]]).smash().end(), [1, 2, 3, 4],
         )
 
     def test_merge(self):
         self.assertEqual(
-            self.qclass([4, 5, 6], [1, 2, 3]).merge().value(),
+            self.qclass([4, 5, 6], [1, 2, 3]).merge().end(),
             [1, 2, 3, 4, 5, 6],
         )
 
         self.assertEqual(
             self.qclass(
                 'moe', 30, True, 'larry', 40, False, 'curly', 50, 1, 1,
-            ).pairwise().value(),
+            ).pairwise().end(),
             [('moe', 30), (30, True), (True, 'larry'), ('larry', 40),
             (40, False), (False, 'curly'), ('curly', 50), (50, 1), (1, 1)]
         )
 
     def test_reduce(self):
         self.assertEqual(
-            self.qclass(1, 2, 3).tap(lambda x, y: x + y).reduce().value(), 6,
+            self.qclass(1, 2, 3).tap(lambda x, y: x + y).reduce().end(), 6,
         )
         self.assertEqual(
-            self.qclass(1, 2, 3).tap(lambda x, y: x + y).reduce(1).value(), 7,
+            self.qclass(1, 2, 3).tap(lambda x, y: x + y).reduce(1).end(), 7,
         )
 
     def test_reduce_right(self):
         self.assertEqual(
             self.qclass([0, 1], [2, 3], [4, 5]).tap(
                 lambda x, y: x + y
-            ).reduce_right().value(), [4, 5, 2, 3, 0, 1],
+            ).reduce_right().end(), [4, 5, 2, 3, 0, 1],
         )
         self.assertEqual(
             self.qclass([0, 1], [2, 3], [4, 5]).tap(
                 lambda x, y: x + y
-            ).reduce_right([0, 0]).value(), [4, 5, 2, 3, 0, 1, 0, 0],
+            ).reduce_right([0, 0]).end(), [4, 5, 2, 3, 0, 1, 0, 0],
         )
 
     def test_roundrobin(self):
         self.assertEqual(
             self.qclass(
                 ['moe', 'larry', 'curly'], [30, 40, 50], [True, False, False]
-            ).roundrobin().value(),
+            ).roundrobin().end(),
             ['moe', 30, True, 'larry', 40, False, 'curly', 50, False],
         )
 
         self.assertEqual(
             self.qclass(
                 ['moe', 'larry', 'curly'], [30, 40, 50], [True, False, False]
-            ).zip().value(),
+            ).zip().end(),
             [('moe', 30, True), ('larry', 40, False), ('curly', 50, False)],
         )
 

File twoq/tests/mixins/man/filtering.py

View file
 class MSliceQMixin(object):
 
     def test_first(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).first(), self.assertEqual, 5,
-        )
+        manq = self.qclass(5, 4, 3, 2, 1).first()
+        self.assertFalse(manq.balanced)
+        manq.sync()
+        self.assertTrue(manq.balanced)
+        self.assertEqual(manq.value(), 5)
+        self.assertFalse(manq.balanced)
 
     def test_nth(self):
         self._false_true_false(
         )
 
     def test_last(self):
-        self._false_true_false(
-            self.qclass(5, 4, 3, 2, 1).last(), self.assertEqual, 1,
-        )
+        manq = self.qclass(5, 4, 3, 2, 1).last()
+        self.assertFalse(manq.balanced)
+        manq.sync()
+        self.assertTrue(manq.balanced)
+        self.assertEqual(manq.value(), 1)
+        self.assertFalse(manq.balanced)
 
     def test_initial(self):
         self._false_true_false(

File twoq/tests/mixins/man/mapping.py

View file
 # -*- coding: utf-8 -*-
-'''mapping test mixins'''
+'''mapping call chain test mixins'''
 
 from inspect import ismodule
 
         self.assertTrue(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        newlist = manq.value()
+        newlist = manq.end()
         self.assertFalse(newlist is testlist)
         self.assertListEqual(newlist, testlist)
         self.assertTrue(newlist[0] is testlist[0])
         self.assertListEqual(newlist[0], testlist[0])
         self.assertTrue(newlist[1] is testlist[1])
         self.assertListEqual(newlist[1], testlist[1])
-        self.assertFalse(manq.balanced)
+#        self.assertFalse(manq.balanced)
 
     def test_deepcopy(self):
         testlist = [[1, [2, 3]], [4, [5, 6]]]
         self.assertTrue(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        newlist = manq.value()
+        newlist = manq.end()
         self.assertFalse(newlist is testlist)
         self.assertListEqual(newlist, testlist)
         self.assertFalse(newlist[0] is testlist[0])
         self.assertListEqual(newlist[0], testlist[0])
         self.assertFalse(newlist[1] is testlist[1])
         self.assertListEqual(newlist[1], testlist[1])
-        self.assertFalse(manq.balanced)
+#        self.assertFalse(manq.balanced)
 
 
 class MRepeatQMixin(object):
         from stuf import stuf
         thing = self.qclass(
                 [('a', 1), ('b', 2), ('c', 3)]
-            ).reup().wrap(stuf).map().shift().value()
+            ).reup().wrap(stuf).map().shift().end()
         self.assertDictEqual(thing, stuf(a=1, b=2, c=3))
 
     def test_each(self):

File twoq/tests/mixins/man/ordering.py

View file
         self.assertFalse(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        manq.value()
-        self.assertFalse(manq.balanced)
+        manq.end()
+        self.assertTrue(manq.balanced)
 
     def test_sample(self):
         manq = self.qclass(1, 2, 3, 4, 5, 6).sample(3)
         self.assertFalse(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        manq.value()
-        self.assertFalse(manq.balanced)
+        manq.end()
+        self.assertTrue(manq.balanced)
 
     def test_shuffle(self):
         manq = self.qclass(1, 2, 3, 4, 5, 6).shuffle()
         self.assertTrue(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        manq.value()
-        self.assertFalse(manq.balanced)
+        manq.end()
+        self.assertTrue(manq.balanced)
 
 
 class MOrderQMixin(MRandomQMixin):

File twoq/tests/mixins/man/queuing.py

View file
 # -*- coding: utf-8 -*-
-'''manual queuing test mixins'''
+'''manual call chain queuing test mixins'''
 
 
 class MQMixin(object):
     def test_delitem(self):
         q = self.qclass(1, 2, 3, 4, 5, 6)
         del q[2]
-        self.assertEqual(q.outsync().value(), [1, 2, 4, 5, 6])
+        self.assertEqual(q.outsync().end(), [1, 2, 4, 5, 6])
 
     def test_remove(self):
         self.assertEqual(
-            self.qclass(1, 2, 3, 4, 5, 6).remove(5).outsync().value(),
+            self.qclass(1, 2, 3, 4, 5, 6).remove(5).outsync().end(),
             [1, 2, 3, 4, 6],
         )
 
     def test_insert(self):
         q = self.qclass(1, 2, 3, 4, 5, 6)
         q.insert(2, 10)
-        self.assertEqual(q.outsync().value(), [1, 2, 10, 3, 4, 5, 6])
+        self.assertEqual(q.outsync().end(), [1, 2, 10, 3, 4, 5, 6])
 
     def test_extend(self):
         self.assertEqual(
-            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().value(),
+            self.qclass().extend([1, 2, 3, 4, 5, 6]).outsync().end(),
             [1, 2, 3, 4, 5, 6],
         )
 
     def test_extendleft(self):
         self.assertEqual(
-            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().value(),
+            self.qclass().extendleft([1, 2, 3, 4, 5, 6]).outsync().end(),
             [6, 5, 4, 3, 2, 1]
         )
 
     def test_append(self):
         self.assertEqual(
-            self.qclass().append('foo').outsync().value(), 'foo'
+            self.qclass().append('foo').outsync().end(), 'foo'
         )
 
     def test_appendleft(self):
         self.assertEqual(
-            self.qclass().appendleft('foo').outsync().value(), 'foo'
+            self.qclass().appendleft('foo').outsync().end(), 'foo'
         )
 
     def test_inclear(self):

File twoq/tests/mixins/man/reducing.py

View file
         self.assertFalse(manq.balanced)
         manq.sync()
         self.assertTrue(manq.balanced)
-        self.assertEqual(stuf(manq.value()), stuf(name='curly', age=60))
-        self.assertFalse(manq.balanced)
+        self.assertEqual(stuf(manq.end()), stuf(name='curly', age=60))
+        self.assertTrue(manq.balanced)
 
     def test_min(self):
         self._false_true_false(