[Python-Dev] Deprecating "instance method" class

Brett Cannon brett at python.org
Fri Apr 5 15:58:47 EDT 2019


On Fri, Apr 5, 2019 at 11:30 AM Jeroen Demeyer <J.Demeyer at ugent.be> wrote:

> On 2019-04-05 17:46, Guido van Rossum wrote:
> > This API is doing no harm, it's not a maintenance
> > burden
>
> What if the following happens?
>
> 1. For some reason (possibly because of this thread), people discover
> instancemethod and start using it.
>
> 2. People realize that it's slow.
>
> 3. It needs to be made more efficient, causing new code bloat and
> maintenance burden.
>

Then we can consider improving the documentation if there are performance
implications. But the point is if there's code out there already using it
without issue then ripping it out of the C API is painful since we don't
have nearly as good of a deprecation setup as we do in Python code. Not
everything about the C APi is about performance.

-Brett


>
> > clearly *some* folks have a use for it.
>
> I'm not convinced.


OK, but as of right now others like me are convinced and we typically err
on the side of backwards-compatibility in these kinds of situations.

-Brett


> I don't think that instancemethod is the right
> solution for functools.total_ordering for example.
>
>
> Jeroen.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190405/0a9627bc/attachment.html>


More information about the Python-Dev mailing list