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 terry.reedy
Recipients larry, ncoghlan, pitrou, terry.reedy, yselivanov
Date 2014-02-21.23:54:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393026880.78.0.914364270671.issue20712@psf.upfronthosting.co.za>
In-reply-to
Content
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__.
History
Date User Action Args
2014-02-21 23:54:40terry.reedysetrecipients: + terry.reedy, ncoghlan, pitrou, larry, yselivanov
2014-02-21 23:54:40terry.reedysetmessageid: <1393026880.78.0.914364270671.issue20712@psf.upfronthosting.co.za>
2014-02-21 23:54:40terry.reedylinkissue20712 messages
2014-02-21 23:54:39terry.reedycreate