Verbose and flexible args and kwargs syntax

Jussi Piitulainen jpiitula at ling.helsinki.fi
Wed Dec 14 04:04:04 EST 2011


Nick Dokos writes:
> Jussi Piitulainen wrote:
> > They recognize modular arithmetic but for some reason insist that
> > there is no such _binary operation_. But as I said, I don't
> > understand their concern. (Except the related concern about some
> > programming languages, not Python, where the remainder does not
> > behave well with respect to division.)
> 
> They are probably arguing that it's uniquely defined only on ZxN and
> that there are different conventions to extend it to ZxZ (the
> programming languages problem that you allude to above - although I
> don't know what you mean by "does not behave well wrt division").

I think Boute [1] says Standard Pascal or some such language failed to
have x div y + x rem y = x, but I can't check the reference now. That
at least waes what I had in mind. Having x rem y but leaving it
underspecified is another such problem: then it is unspecified whether
the equation holds.

[1] <http://en.wikipedia.org/wiki/Modulo_operation>

> If you choose one convention and stick to it, it becomes a
> well-defined binary operation.

That's what I'd like to think.



More information about the Python-list mailing list