PEP 303: Extend divmod() for Multiple Divisors
johnroth at ameritech.net
Wed Jan 1 13:45:03 CET 2003
"Thomas Bellman" <bellman+pep-divmod at lysator.liu.se> wrote in message
news:ausiq8$egi$1 at news.island.liu.se...
> This PEP proposes extending divmod() to accept multiple divisors.
> Please give your comments. It can also be read on the web at
> <URL: http://www.python.org/peps/pep-0303.html>.
I want to object to this one strongly, on the basis that it is
a special case of something that, if it's useful at all, should
be generalized to include all of the operators.
Erik Mac Francis' comment about the APL encode operator
sounds about right, although I'd much prefer that thinking
go in the direction of functional languages.
I don't find the use cases very compelling. Sure, they exist,
but how many of us actually use chained division for those
conversions in every day life rather than use a library
module? And how many of those uses are actually
the performance bottleneck in the system?
As far as the nuts and bolts go, the operand should be
a sequence, not simply strung out as operands. There are
several reasons for this, but the major one is consistency:
if the result is a list, then the input operand should also be
More information about the Python-list