title: Python: uniquely identify a function from a module
body: <p>I am not really a programmer but a computational statistician, so I may understand complex algorithms but not simple programming constructs.</p>
  
  <p>My original problem is to check within a function if a module function is callable. I looked around and decided to go for a <code>try</code> (call function) - <code>except</code> (import module) to make it simple. I'd love to search <code>sys.mod</code> for this but I am running in some identifiability problems.</p>
  
  <p>My current problem is that there are many ways of importing a function from a module: <code>import module</code> will define the function as <code>module.function</code> but <code>from module import function</code> will define it as <code>function</code>. Not to mention <code>from module import function as myfunction</code>. Therefore the same function can be called in several different ways.</p>
  
  <p>My question is: is there a unique "signature" for a function that can be traced if the module is loaded? It would be fantastic to have the actual call alias to it.</p>
  
  <p>ps besides: <code>mod</code> is mathematical function and <code>sys.mod</code> returns a list of loaded modules, but python (2.7) does not complain when you shadow the built-in <code>mod</code> function by doing the following, <code>from sys import mod</code>. I find this a bit awkward - is there any way to avoid this sort of shadowing programatically?</p>