Marek Kubica <ma...@xivilization.net> added the comment: Well, some Schemes have an CURRYR variant which creates partial functions with positional arguments from the right but the current solution with partial accepting keywords is way more flexible since I can pre-set any arguments I like in such a function in any order. Doing so by using keyword arguments looks cleaner than by using the position of the argument.
Compare ``partial(operator.mod, (2, 2))`` with ``partial(operator.mod, divisor=2)`` and at least to me, it is clearer what is happening in the second case. Even ``partial(operator.mod, b=2)`` looks simpler, albeit the name ``b`` is not particularly descriptive. The names ``a`` and ``b`` as used in many operators are indeed not very useful but renaming them wouldn't be a problem since nobody currently depends on ``a`` or ``b`` in their code; just in the order. That said, ``a`` and ``b`` are not so bad actually, because I couldn't think of better names for ``a`` and ``b`` in ``operator.contains(a, b)``. The nice thing now is, that partial can indeed replace many lambdas so not allowing partial to use operator seems just a random restriction. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5567> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com