[Python-Dev] "PyObject *module" for module-level functions?
Nick Coghlan
ncoghlan at gmail.com
Tue Nov 5 11:31:34 CET 2013
On 5 Nov 2013 17:19, "Stefan Behnel" <stefan_ml at behnel.de> wrote:
>
> Larry Hastings, 04.11.2013 23:47:
> > When Clinic generates a function, it knows what kind of callable it
> > represents, and it names the first argument (the "PyObject *")
accordingly:
> >
> > * module-level function ("self"),
> > * method ("self"),
> > * class method ("cls"), or
> > * class static ("null").
> >
> > I now boldly propose that for the first one, the module-level function,
the
> > PyObject * parameter should be named "module". The object passed in is
the
> > module object, it's not a "self" in any conventional sense of the word.
> >
> > This would enhance readability, as I assert the name "self" there is
> > confusing. The argument is rarely used on module-level functions
>
> Since this only relates to the argument clinic, I assume this change
> doesn't get in the way of making module level functions real methods of
the
> module, does it?
Right, in that case (regardless of whether or not someone was using
argument clinic to do it), the callables would be declared as actual
methods of the custom module type rather than as module level functions.
Cheers,
Nick.
>
> Stefan
>
>
> _______________________________________________
> 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/ncoghlan%40gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131105/007ad04c/attachment.html>
More information about the Python-Dev
mailing list