A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-August/081969.html below:

[Python-Dev] no tp_traverse for dict iters

[Python-Dev] no tp_traverse for dict iters [Python-Dev] no tp_traverse for dict itersRobert Schuppenies robert.schuppenies at gmail.com
Mon Aug 25 10:32:48 CEST 2008
Hi.

Could you please explain to me why some iterators have a tp_traverse
implementation and others do not? For example tupleiterator has one,
but none of the dict iterators. Same for set iterators (and possibly
others). It shows in Python when you use the get_referents function.

>>> t = (1,2,3)
>>> gc.get_referents(iter(t))
[(1, 2, 3)]
>>> s = set([1,2,3])
>>> gc.get_referents(iter(s))
[]
>>> d = {1:1, 2:2}
>>> gc.get_referents(iter(d))
[]

And is it correct that you can rephrase the question to 'why some
iterators are seen as container objects and others are not'?

thanks,
robert



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4