On 2022-09-18 at 09:11:28 +0000, Stefan Ram <r...@zedat.fu-berlin.de> wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes (abbreviated): > >types.MethodType( function, instance ) > >functools.partial( function, instance ) > >new_method.__get__( instance ) > > I wonder which of these three possibilities expresses > the idea of creating a new method from a function and > an instance most clearly. The first one. And only the first one. The second one requires too much inside knowledge of Python to make the leap from currying to instance method. The third one doesn't even mention the function. Also, in Python, if I'm applying dunder methods directly (it's okay to write them), then I'm doing something wrong. -- https://mail.python.org/mailman/listinfo/python-list