2.2.2 Annoyance

Michael Hudson mwh at python.net
Mon Nov 24 13:30:11 EST 2003


"Miklós" <nospam at nowhere.hu> writes:

> 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
> """

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.

> > > 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.

I haven't had the time to read all posts to this ng for some time...

> (That site wants to stay with 2.2 for the time being.)

OK.

> 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..)

2.2.3 will not make any difference on this point.

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