2.2.2 Annoyance
Miklós
nospam at nowhere.hu
Mon Nov 24 14:33:30 EST 2003
Michael Hudson <mwh at python.net> wrote in message
news:m37k1pzkjw.fsf at pc150.maths.bris.ac.uk...
> "Miklós" <nospam at nowhere.hu> writes:
>
> > """
> > __getitem__(self, key)
> > Called to implement evaluation of self[key]. For sequence types, the
> > accepted keys should be integers and slice objects. Note that the
special
> > interpretation of
> > """
>
> I think this is talking about implementing __getitem__, not calling it
> directly. Historically these things have been quite different, though
> they are becoming less so.
>
Well, I've never been really into the guts of Python ... but could you shed
some light for me on that why these two things are different?
What I experienced was this "feature" broke my code (actually it was in a
3rd party code library) and it took a while for me to recognize the
documentation was wrong
(or whatever, depending on your explanation..) and slice objects shouldn't
be passed to __getitem__ that way in Python 2.2
(and that this works for Python 2.3)
>
> 2.2.3 will not make any difference on this point.
Well, then my patches will stay and slow down things a bit.
Cheers,
Miklós
>
> Cheers,
> mwh
>
> --
> ARTHUR: Don't ask me how it works or I'll start to whimper.
> -- The Hitch-Hikers Guide to the Galaxy, Episode 11
More information about the Python-list
mailing list