[Python-Dev] Mini-Pep: Simplifying the Integral ABC

Guido van Rossum guido at python.org
Thu Jun 5 06:13:34 CEST 2008


I think it's fine to remove 3-arg pow() from the ABC; implementations
are of course free to provide it.

Raymond, why don't you cook up a patch? It should patch both the PEP
and numbers.py.

On Wed, Jun 4, 2008 at 8:44 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
> On Sun, Jun 1, 2008 at 2:15 AM, Raymond Hettinger <python at rcn.com> wrote:
>>
>> Proposal
>> --------
>> Remove non-essential abstract methods like __index__, three argument
>> __pow__,
>> __lshift__, __rlshift__, __rshift__, __rrshift__, __and__, __rand__,
>> __xor__,
>> __rxor__, __or__, __ror__, and __invert__, numerator, and denominator.
>
> +1 from me.
> I'd support removing all these, minus the exceptions already pointed out
> (__index__, numerator, denominator).  As a (so far incomplete) effort
> to speed up the Decimal type I recently implemented a decimal-based
> integer type;  this type would seem a natural candidate to inherit
> from Integral, but the logical and shift operators above make less sense
> for this type.
> The other odd man out here is three-argument pow;  this *is* a
> method that makes sense for integers without reference to the
> way they're stored.  So maybe this should stay.  (Though I've
> occasionally wondered why three-argument pow is part of the
> core language, rather than being in the standard library.)
> Mark
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/guido%40python.org
>
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list