On Mar 10, 3:58 am, duccio <[EMAIL PROTECTED]> wrote:
> Hello!
> Someone knows if it's possible to make this __iter__ function with just
> one 'yield' intead of two?
> Is there some simpler way to make this __iter__ iter through all nodes?
> Thanks!
>
> class Node:
> def __init__(self, data=N
Paul Hankin wrote:
> On Mar 10, 3:12 am, George Sakkis <[EMAIL PROTECTED]> wrote:
>> On Mar 9, 7:37 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> On Mar 9, 8:58 pm, duccio <[EMAIL PROTECTED]> wrote:
Someone knows if it's possible to make this __iter__ function with just
one 'yie
On Mar 10, 3:12 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Mar 9, 7:37 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mar 9, 8:58 pm, duccio <[EMAIL PROTECTED]> wrote:
>
> > > Someone knows if it's possible to make this __iter__ function with just
> > > one 'yield' intead of two?
>
On Mar 9, 7:37 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Mar 9, 8:58 pm, duccio <[EMAIL PROTECTED]> wrote:
>
> > Someone knows if it's possible to make this __iter__ function with just
> > one 'yield' intead of two?
> > ...
> > def __iter__(self):
> > yield self #1
> >
On Mar 9, 8:58 pm, duccio <[EMAIL PROTECTED]> wrote:
> Someone knows if it's possible to make this __iter__ function with just
> one 'yield' intead of two?
> ...
> def __iter__(self):
> yield self #1
> for n in self.childs:
> for nn in n.__iter__():
>
duccio schrieb:
>
> Hello!
> Someone knows if it's possible to make this __iter__ function with just
> one 'yield' intead of two?
> Is there some simpler way to make this __iter__ iter through all nodes?
> Thanks!
>
> class Node:
> def __init__(self, data=None):
> self.childs=[]
>