[Python-3000] Removing functions from the operator module
Guido van Rossum
guido at python.org
Mon Jul 3 17:16:01 CEST 2006
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 (and the footnote [17] is
particularly unhelpful -- who came up with the idea of having 7
different places in the PEP link to 5 different parts of the manual
via the same footnote?).
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().
The key thing to understand about the operator module is that its
methods correpond to the C-level APIs. As the C-level API changes we
can expect more changes to the operator module.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list