s...@blueyonder.co.uk wrote:
Hi all,

On Thu, Jan 29, 2009 at 6:12 AM, Ben North <b...@redfrontdoor.org> wrote:
I find 'functools.partial' useful, but occasionally I'm unable to use it
because it lacks a 'from the right' version.
-1

For me, the main objection to a partial that places
its stored positional arguments from the right is
that you don't know which positions those arguments
will actually occupy until the partial is called.

Certainly this interacts in a magical way with keyword args.
That definitional problem is the reason there was no curry_right
in the original recipe that was the basis of the first partial.

If you have:
    def button(root, position, action=None, text='*', color=None):
        ...
    ...
    blue_button = partial(button, my_root, color=(0,0,1))

Should partial_right(blue_button, 'red') change the color or the text?
It is computationally hard to do that (may have to chase chains of
**kwarg-passing functions), but even hard to document.

So, I'd avoid it.

--Scott David Daniels
scott.dani...@acm.org

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to