D
daryn
I'm just playing around with the iter function and I realize that I
can use the iterator returned by it long after the original object has
any name bound to it. Example:
it seems as if the original object is never being garbage collected
even though there is no name bound to it. Does the name bound to the
iterator object count as a reference to the original object for
garbage collection purposes? Is there some way to retrieve/manipulate
the original object via the iterator?
Just trying to understand how this all works.
-thanks for any help you can give
daryn
can use the iterator returned by it long after the original object has
any name bound to it. Example:
101a=[1,2,3,4]
b=iter(a)
b.next() 1
a[1]=99
a[3]=101
del a
b.next() 99
b.next() 3
b.next()
it seems as if the original object is never being garbage collected
even though there is no name bound to it. Does the name bound to the
iterator object count as a reference to the original object for
garbage collection purposes? Is there some way to retrieve/manipulate
the original object via the iterator?
Just trying to understand how this all works.
-thanks for any help you can give
daryn