[Python-3000] Removing functions from the operator module

Collin Winter collinw at gmail.com
Mon Jul 3 17:40:43 CEST 2006


On 7/3/06, Guido van Rossum <guido at python.org> wrote:
> On 7/3/06, Michael Urman <murman at gmail.com> wrote:
> > On 7/3/06, Guido van Rossum <guido at python.org> wrote:
> > > On 7/3/06, Collin Winter <collinw at gmail.com> wrote:
> > > > Stupid question: why? What's the better spelling of operator.add?
> > >
> > > +
> >
> > I reject your slippery slope argument that we'd have to remove
> > operator.add. Not that we'd be able to tell, but + is not callable.
>
> It turns out I was misled by Collin's claim that the PEP wants
> isCallable and sequenceIncludes removed "because there are better,
> more obvious ways to spell these things." He must have made up the
> motivation, as the PEP doesn't give any.

I was inferring that motivation based on the presence of alternate,
shorter spellings: in the case of operator.sequenceIncludes(), the
shorter version is operator.contains(); in the case of
operator.isCallable(), the shorter version is the callable() builtin.
(I thought I had seen some mailing list traffic hinting that
callable() would stick around after all; I guess I was wrong.)

> I believe that the real reasons are different in each case:
>
> -  operator.sequenceIncludes() is redundant with operator.contains
>
> - operator.isCallable() corresponds to the callable() built-in and the
> PEP also wants to remove callable().
>
> I don't see how this generalizes to operator.truth() or operator.abs().

Because these are redundant as well: operator.truth() is redundant
with bool() and operator.abs() with the builtin abs().

Collin Winter


More information about the Python-3000 mailing list