Marc 'BlackJack' Rintsch: > I don't know if this is documented somewhere but the `reversed()` function > looks for a `__reversed__()` method that returns an iterator.
You are right, thank you, I have done some tests already, and I'll soon add that method too. ------------------- Partially related. I have used the new Google code search: http://www.google.com/codesearch/advanced_code_search To find the usage frequency of Python dict methods: 456 ".itervalues()" lang:python 415 ".iteritems()" lang:python 403 ".iterkeys()" lang:python 387 ".values()" lang:python 385 ".clear()" lang:python 256 ".update(" lang:python 254 ".fromkeys(" lang:python 224 ".has_key(" lang:python 201 ".get(" lang:python 200 ".items()" lang:python 159 ".popitem()" lang:python 113 "a.setdefault(" lang:python The results are quite approximated, but they seem meaningful. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list