[Python-Dev] Mini-Pep: Simplifying the Integral ABC (original) (raw)

Aahz aahz at pythoncraft.com
Sun Jun 1 21:53:00 CEST 2008


On Sat, May 31, 2008, Raymond Hettinger 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.

The only thing I object to is removing index -- the whole point of an integral class is that it is substitutable as an index for sequences in a way that other numeric types are not. Having an index special method is a key indicator for duck-typing purposes not covered by the ABC.

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

Need a book? Use your library!



More information about the Python-Dev mailing list