Terry J. Reedy added the comment: The premise of the builtins signature project is that we should work toward eliminating unnecessary differences between functions coded in Python and those coded otherwise. Part of inspect.signature is a clause to remove the first parameter of the underlying function for bound methods#. One would like to write the equivalent of
if ismethod(f) and f.params[0] is not *args, remove f.params[0]. I understand Larry as proposing that the code in .signature for ismethod(C_func) properly belongs in .ismethod itself, for anyone to use, and I agree. However, use of this code has to be an option turned off by default. My revised proposal is to add 'other_lang=False' and "If *other_lang* is true, also return True if the object is a bound method written in another language." Another name might be 'non_py'. I don't think the name matters too much as long as the default is False for Python-only. # Another unnecessary difference is that [].append, for instance, does not have a .__func__ attribute linking to list.append, even though it must have one internally. Perhaps bound C methods should also have .__func__. ---------- nosy: +terry.reedy stage: needs patch -> test needed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20712> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com