[issue28838] Uniformize argument names of "call" functions (C API)

Serhiy Storchaka report at bugs.python.org
Thu Dec 1 03:46:26 EST 2016


Serhiy Storchaka added the comment:

> * Callable object: callable, o, callable_object => func

The original names better describes the argument type in functions like PyObject_Call(). It works not just with functions, but with arbitrary callables. For example it is used with type objects for creating instances.

> * Method name: name or nameid => method

The parameter is not a *method object*, but a method *name*. You have to pass an object and a method names to call a method.

> Serhiy: Can you please elaborate "Other changes looks not well justified too."?

Renaming obj to arg0 looks questionable to me. I would rather rename func to method (this is a true unbound method, not method name as in PyObject_CallMethod()).

It would be better to uniformize parameter names in the documentation (and perhaps in headers) and left sources untouched unless we rewrite particular functions. Otherwise it looks as code churn. It would be nice to formalize naming rules in PEP 7.

See also issue18697.

----------
stage:  -> patch review

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28838>
_______________________________________


More information about the Python-bugs-list mailing list