Nick Coghlan wrote:
The initial suggestion was to provide a __get__ method on partial objects, which forces the insertion of the reference to self at the beginning of the argument list instead of at the end:

    def __get__(self, obj, type=None):
        if obj is None:
            return self
        return partial(self.fn, obj, *self.args, **self.kw)


just a note:

I don't see why this is not also a possible definition:

return partial(self.fn, *(self.args+(obj,)), **self.kw)

it may be impractical, but it would implement the direct mechanics of partial should behave like a function.
_______________________________________________
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