[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-23 Thread Nick Coghlan
Nick Coghlan added the comment: The problem is that "ismethod()" is not a particularly well-defined concept, except insofar as it means "behaves the same way as the callable returned when a Python function is retrieved through a class instance". "isboundmethod()" could be well-defined, especia

[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-21 Thread Terry J. Reedy
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 f

[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-21 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the lower level APIs in the inspect module *aren't* designed to hide the implementation details from introspection code, they're there as helpers to let introspection code decide what assumptions are valid. For true Python code, you can do many more inter

[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: The docs are quite clear about that: inspect.ismethod(object) Return true if the object is a bound method written in Python. In other words, this is not a bug, and there's probably code in the wild relying on it. -- nosy: +ncoghlan, pitrou ___

[issue20712] Make inspect agnostic about whether functions are implemented in Python or C

2014-02-20 Thread Larry Hastings
New submission from Larry Hastings: Some of the methods on the inspect module behave differently depending on whether the callable passed in was implemented in C or in Python. For example, ismethod() only returns True for bound methods implemented in Python. I assert that the interface presen