MCPcopy Index your code
hub / github.com/RustPython/RustPython / _tee

Class _tee

Lib/test/test_itertools.py:1809–1829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1807 return tuple(result)
1808
1809 class _tee:
1810
1811 def __init__(self, iterable):
1812 it = iter(iterable)
1813 if isinstance(it, _tee):
1814 self.iterator = it.iterator
1815 self.link = it.link
1816 else:
1817 self.iterator = it
1818 self.link = [None, None]
1819
1820 def __iter__(self):
1821 return self
1822
1823 def __next__(self):
1824 link = self.link
1825 if link[1] is None:
1826 link[0] = next(self.iterator)
1827 link[1] = [None, None]
1828 value, self.link = link
1829 return value
1830
1831 # End tee() recipe #############################################
1832

Callers 1

teeMethod · 0.90

Calls

no outgoing calls

Tested by 1

teeMethod · 0.72