conflicting __getitem__ and __iter__ orderings harmful?
Just
just at xs4all.nl
Thu May 1 13:59:17 EDT 2003
In article <radsa.24272$xw4.9216 at nwrdny01.gnilink.net>,
"Raymond Hettinger" <vze4rx4y at verizon.net> wrote:
> > If I implement __getitem__ and __delitem__ by id, but
> > __iter__ ordered by seq, am I committing heinous crimes against
> > python abstractions and conventions?
>
> The code smells a bit like an impending heinous
> crime against a future maintainer.
I don't agree, as long as you see id's as keys, there's absolutely
nothing wrong with what the OP proposes. But you're right in pointing
him towards the dict API...
Just
More information about the Python-list
mailing list