[Python-ideas] PEP draft: Unifying function/method classes

Nick Coghlan ncoghlan at gmail.com
Tue Apr 3 09:50:26 EDT 2018


On 1 April 2018 at 00:48, Jeroen Demeyer <J.Demeyer at ugent.be> wrote:
> I have prepared a PEP draft for unifying function/method classes. You can
> find it at
>
> https://github.com/jdemeyer/PEP-functions
>
> This has not officially been submitted as PEP yet, I want to hear your
> comments first.

I've only read the description of the proposed type heirarchy so far,
but I really like where you're heading with this.

A couple of specific naming suggestions:

* method -> bound_method

"method" is an overloaded term, and this will make it clearer that
these objects are specifically for bound methods.

* generic_function -> defined_function

"Generic function" already refers to functions decorated with
functools.singledispatch (as well as the general concept of generic
functions), so re-using it for a different purpose here would be
confusing.

I don't have a particularly great alternative name to suggest, but
"defined_function" at least takes its inspiration from the "def"
keyword, and the fact that these functions are significantly better
defined than builtin ones (from a runtime introspection perspective).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list