any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Wolfgang Maier
Hi, is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is implemented in Python or C before calling into it ? Thanks, Wolfgang -- https://mail.python.org/mailman/listinfo/python-list

Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Stefan Behnel
Wolfgang Maier schrieb am 26.09.2014 um 09:47: is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is implemented in Python or C before calling into it ? Not really. Both can have very different types and very different interfaces. There

Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Chris Angelico
On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de wrote: Hi, is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is implemented in Python or C before calling into it ? I'm not sure you can say for

Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Stefan Behnel
Chris Angelico schrieb am 26.09.2014 um 10:42: On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote: is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is implemented in Python or C before calling into it ? I'm not sure you can say

Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Ian Kelly
On Fri, Sep 26, 2014 at 6:12 AM, Stefan Behnel stefan...@behnel.de wrote: Chris Angelico schrieb am 26.09.2014 um 10:42: On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote: is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is

Re: any way to tell at runtime whether a callable is implemented in Python or C ?

2014-09-26 Thread Terry Reedy
On 9/26/2014 12:10 PM, Ian Kelly wrote: On Fri, Sep 26, 2014 at 6:12 AM, Stefan Behnel stefan...@behnel.de wrote: On Fri, Sep 26, 2014 at 5:47 PM, Wolfgang Maier wrote: is there any reliable and inexpensive way to inspect a callable from running Python code to learn whether it is implemented