]> granicus.if.org Git - python/commit
Improvements to coding for itertools.tee():
authorRaymond Hettinger <python@rcn.com>
Sat, 25 Oct 2003 06:37:47 +0000 (06:37 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 25 Oct 2003 06:37:47 +0000 (06:37 +0000)
commit4514369f27c8c81af0736782c98689457df39ed5
tree90a9d1bb0ce29c335c845908fde347c11b8c291d
parent23b44a39cec5ccebb6c6eb1e94eccbd6e8ce758e
Improvements to coding for itertools.tee():

* Add error checking code to PyList_Append() call.

* Replace PyObject_CallMethod(to->outbasket, "pop", NULL) with equivalent
  in-line code.  Inlining is important here because the search for the
  pop method will occur for every element returned by the iterator.

* Make tee's dealloc() a little smarter.  If the trailing iterator is
  being deallocated, then the queue data is no longer needed and can
  be freed.
Modules/itertoolsmodule.c