1

I'm working on a script that imports log from math. I've decided to look inside math.py in order to see how def log looks like, just for the sake of learning how it's been defined. For my surprise, inside the math.py I couldn't find any log def. Then I saw scimath.py; there, one can find a def log(x):, but it isn't the function I'm importing to my script, since I'm clearly using from math import log.

Could anybody help me to understand what's going on there and tell me where can I find math.log's def?

Josh
  • 12,448
  • 10
  • 74
  • 118

1 Answers1

0

If you look at the Python math page, at the bottom, you can see the disclaimer that most Python math functions are just wrappers around C library functions. So, the answer is that it's probably some C source somewhere, depending on which you're using (Cython, Jython, etc), as noted here.

Community
  • 1
  • 1
Josh
  • 12,448
  • 10
  • 74
  • 118