MCPcopy Index your code
hub / github.com/python/cpython / _tee

Class _tee

Lib/test/test_itertools.py:1857–1877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1855 return tuple(result)
1856
1857 class _tee:
1858
1859 def __init__(self, iterable):
1860 it = iter(iterable)
1861 if isinstance(it, _tee):
1862 self.iterator = it.iterator
1863 self.link = it.link
1864 else:
1865 self.iterator = it
1866 self.link = [None, None]
1867
1868 def __iter__(self):
1869 return self
1870
1871 def __next__(self):
1872 link = self.link
1873 if link[1] is None:
1874 link[0] = next(self.iterator)
1875 link[1] = [None, None]
1876 value, self.link = link
1877 return value
1878
1879 # End tee() recipe #############################################
1880

Callers 1

teeMethod · 0.90

Calls

no outgoing calls

Tested by 1

teeMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…