[Python-3000] What about operator.*slice?

Barry Warsaw barry at python.org
Tue Sep 4 20:51:49 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sep 4, 2007, at 2:08 PM, Brett Cannon wrote:

> On 9/4/07, Guido van Rossum <guido at python.org> wrote:
>> Since x[a:b] is not basic syntax (like it once was) but simply the
>> combination of operator.getitem and slice() I don't see the point of
>> keeping operator.getitem.
>>
>> PS. I don't know how useful the operator module really is -- in all
>> those years it's existed I haven't really used it myself, and I'm
>> always baffled when I see code using it.
>>
>
> The only great use I have found for it myself is attrgetter and
> itemgetter, but those were added by Raymond in 2.5 (I think).
> Otherwise I never use it.

Same here, although very occasionally I use one or two others.  I  
still think attrgetter could be made more useful by dereferencing dot- 
paths.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQCVAwUBRt2pRXEjvBPtnXfVAQK59gQAn7KTJHk3R3JTLErEfljDKZ7B2H0WEZD3
ljpnDc7Kn5GNAfWdNueJNigMKGctKhK3ZEO9Gw8TNxTJonhOCjLhSPZPrCMlM3tV
CeEieXw8VBFMPA0biDEtq3Ic6x/6yuX3xXmVPQTOOY1kAScfFmeb1bi17xPkhdsl
36FrPEsePig=
=rR0Y
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list