This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients andribas404, esoma, mark.dickinson
Date 2021-02-24.17:25:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614187537.38.0.46890406504.issue43310@roundup.psfhosted.org>
In-reply-to
Content
The key difference between the func_del function and the instance C() is that func_del is a (non-data) descriptor in addition to being callable, while the instance C() is not. That makes func_del usable as a method.

If you define C as follows, you'll see the behaviour you expect:


    class C:
        def __call__(self, *args, **kwargs):
            print("call", args, kwargs)

        def __get__(self, obj, objtype=None):
              return MethodType(self, obj)

Useful reference for descriptors: https://docs.python.org/3/howto/descriptor.html

I'll close here, since this is neither a bug nor a feature request.
History
Date User Action Args
2021-02-24 17:25:37mark.dickinsonsetrecipients: + mark.dickinson, esoma, andribas404
2021-02-24 17:25:37mark.dickinsonsetmessageid: <1614187537.38.0.46890406504.issue43310@roundup.psfhosted.org>
2021-02-24 17:25:37mark.dickinsonlinkissue43310 messages
2021-02-24 17:25:37mark.dickinsoncreate