set and dict iteration
Aaron Brady
castironpi at gmail.com
Sat Aug 18 16:29:13 EDT 2012
On Friday, August 17, 2012 4:57:41 PM UTC-5, Chris Angelico wrote:
> On Sat, Aug 18, 2012 at 4:37 AM, Aaron Brady <castironpi at gmail.com> wrote:
>
> > Is there a problem with hacking on the Beta?
>
>
>
> Nope. Hack on the beta, then when the release arrives, rebase your
>
> work onto it. I doubt that anything of this nature will be changed
>
> between now and then.
>
>
>
> ChrisA
Thanks Chris, your post was encouraging.
I have a question about involving the 'tp_clear' field of the types.
http://docs.python.org/dev/c-api/typeobj.html#PyTypeObject.tp_clear
'''
...The tuple type does not implement a tp_clear function, because it’s possible to prove that no reference cycle can be composed entirely of tuples.
'''
I didn't follow the reasoning in the proof; the premise is necessary but IMHO not obviously sufficient. Nevertheless, the earlier diagram contains an overt homogeneous reference cycle.
Reposting: http://home.comcast.net/~castironpi-misc/clpy-0062%20set%20iterators.png
In my estimate, the 'tp_traverse' and 'tp_clear' fields of the set doesn't need to visit the auxiliary collection; the same fields of the iterators don't need to visit the primary set or other iterators; and references in the linked list don't need to be included in the iterators' reference counts.
Can someone who is more familiar with the cycle detector and cycle breaker, help prove or disprove the above?
More information about the Python-list
mailing list