News for hackers. Stuff that matters.
Re:Celery 3.0 has been released by simonpantzare on Sunday July 08, 2012 @07:41AM (#4214368)
I find this[1] example in Getting Started/Next Steps to be backwards:

    # incomplete partial:  add(?, 2)
    >>> s2 = add.s(2)
    # resolves the partial: add(8, 2)
    >>> res = s2.delay(8)
    >>> res.get()
    10
Shouldn't it behave like functools.partial[2]?

    >>> import functools
    >>> abc = lambda a, b, c: (a, b, c)
    >>> bc = functools.partial(abc, "a")
    >>> bc("b", "c")
    ('a', 'b', 'c')
1. http://docs.celeryproject.org/en/latest/getting-started/next...

2. http://docs.python.org/library/functools.html#functools.part...

Re:Celery 3.0 has been released by asksol on Sunday July 08, 2012 @08:46AM (#4214447)
Very good question!

The reason is that I found that it better matches what you use them for in Celery, since they are used e.g. to forward results from the previous tasks to a callback. Often you have a signatures like: def blur_image(image, amount=1), where the partial is used like render_image.s(file) | blur_image.s()

functools.partial is usually used the other way; it's most common to create functools.partials where the first argument is satisfied.