Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78371 > unrolled thread

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

Started byStefan Behnel <stefan_ml@behnel.de>
First post2014-09-26 09:59 +0200
Last post2014-09-26 09:59 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: any way to tell at runtime whether a callable is implemented in Python or C ? Stefan Behnel <stefan_ml@behnel.de> - 2014-09-26 09:59 +0200

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

FromStefan Behnel <stefan_ml@behnel.de>
Date2014-09-26 09:59 +0200
SubjectRe: any way to tell at runtime whether a callable is implemented in Python or C ?
Message-ID<mailman.14388.1411718412.18130.python-list@python.org>
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 are types, classes, functions, methods, objects with a
dedicated __call__() method, ... Any of them can be implemented in Python
or C (or other native languages, or a mix of more than one language).

What's your use case? There might be other ways to achieve what you want.

Stefan

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web