[Python-ideas] Cofunctions/yield from -> fibers

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Aug 13 10:11:31 CEST 2010


Scott Dial wrote:

> Yes, I think even something as trivial as an example in-order iteration
> over a binary tree should be included since it is accessible and the
> benefits of readability, efficiency, and correctness are apparent:

That's a nice example -- I've just added it to the web page
(with appropriate attribution).

> while also being agnostic to whether left/right is also a BinaryTree
> object (e.g., a tuple or list or some other user-defined type works just
> as well as an iterable leaf) -- a feat that would be rather complicated
> and verbose otherwise.

That's not actually true -- a for-loop would work with any
iterable node object just as well.

-- 
Greg



More information about the Python-ideas mailing list