<html>
<head>
</head>
<body>
I don't know the answer (I assume so), but I do know that channels provide<br>
far more general functionality. The yeild thing only goes one level deep<br>
into a function call, whereas a channel can pass values from anywhere inside<br>
a computation.<br>
<br>
For example you could "linearize" a tree something like this<br>
<br>
def preorderToChannel(tree, channel):<br>
(node, children) = tree<br>
channel.send(node)<br>
for child in children:<br>
preorderToChannel(child, channel)<br>
<br>
...then launch preorderToChannel(tree, channel) in its own tasklet.<br>
<br>
As I understand it implementing a "preorder generator" using<br>
the "yeild" construct would be much more complicated, unless<br>
you cheated and stashed the result in a list or something first.<br>
<br>
Please correct me if I'm wrong...<br>
<br>
-- Aaron Watters<br>
<br>
Robert Oschler wrote:<br>
<blockquote type="cite" cite="mid:OE17zBW76c4EOBHkJZb0000669a@hotmail.com">
<meta content="MSHTML 5.50.4807.2300" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Does Stackless support Python 2.2 generator
functions?</font></div>
<div> </div>
<div><font face="Arial" size="2">thx</font></div>
<div> </div>
</blockquote>
<br>
</body>
</html>