dicts + amb
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Wed Oct 11 17:56:03 EDT 2006
In <1160601017.272078.63240 at h48g2000cwc.googlegroups.com>, bearophileHUGS
wrote:
> I have implemented yet another Odict class:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498195
> It's very slow, but it is O(1) for get, set and del too.
>
> I have added ritervalues(), rkeys(), etc methods because I presume I
> can't use the reversed(). So can an __riter__ hook be generally useful?
> (I have seen few comments about it in the discussion regarding PEP
> 322).
I don't know if this is documented somewhere but the `reversed()` function
looks for a `__reversed__()` method that returns an iterator.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list