2.2.2 Annoyance

Miklós nospam at nowhere.hu
Mon Nov 24 13:25:19 EST 2003


Michael Hudson <mwh at python.net> wrote in message
news:m3r7zxzukb.fsf at pc150.maths.bris.ac.uk...
> "Jegenye 2001 Bt" <nospam at nowhere.hu> writes:
>
> > According to the manuals of Python 2.2.2, passing a slice object to
> > __getitem__ is all right and should work...
>
> Really?  Where does it say that?

Python Reference Manual,
3.3.4 Emulating container types
(Release 2.2.2, documentation updated on October 14, 2002. )
"""
__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
"""

>
> > For Python 2.3  passing a slice object to __getitem__ does work though.
>
> Yes.  Do you have a good reason for sticking to 2.2?
>
Yes, see my previous post on this. (That site wants to stay with 2.2 for the
time being.)

Actually I patched the code to circumvent this and I haven't tried 2.2.3 as
for this yet. (I didn't know about  2.2.3 until Terry's response..)

All this is no big deal ... unless you pull too many hairs of your receding
head because of a bug like this. :-))

Cheers,
  Miklós

> Cheers,
> mwh
>
> --
>   Python enjoys making tradeoffs that drive *someone* crazy <wink>.
>                                        -- Tim Peters, comp.lang.python






More information about the Python-list mailing list