[Python-ideas] Redefining method

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jul 30 18:10:32 EDT 2018


Jamesie Pic wrote:
> def o.bar(self): ...

You could get almost the same effect with

    from functools import partial

    def bar(self, other_args):
       ...

    o.bar = partial(bar, o)

But IMO this is nowhere near being a common enough thing to
do to justify having special syntax for it.

-- 
Greg


More information about the Python-ideas mailing list