-1

I can call a function in python. And it is not a built-in.

Is there a way to check in which module or class this method is defined?

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • Similar : https://stackoverflow.com/questions/2020014/get-fully-qualified-class-name-of-an-object-in-python – ankit7540 Oct 18 '21 at 05:59

1 Answers1

-1

Just found it. Seems the inspect module can do the trick.

>>> import inspect
>>> inspect.getmodule(xxx)
smwikipedia
  • 61,609
  • 92
  • 309
  • 482