0

I'm trying to see source code for python's build in functions like str.lower() or str.lstrip(). I was trying inspect.getsource() but this didn't work. Is there any other way to view source codes for built ins?

Mat
  • 195,986
  • 40
  • 382
  • 396
TheStrangeQuark
  • 1,926
  • 4
  • 26
  • 54
  • I always found a tad difficult finding information about the details of the C implementation of Python's basic types. Regular IDEs won't do a good job because they're coded in C, and they've been compiled (so there's no _source_) It takes some googling in a per-case basis... http://www.laurentluce.com/posts/python-string-objects-implementation/ You have the repository with the source code here: https://www.python.org/downloads/source/ – BorrajaX Mar 01 '15 at 17:49
  • What version of Python? What bitness (x86, x86-64?) – IronManMark20 Mar 01 '15 at 18:02
  • `inspect` won't work because the source code for those methods **isn't in Python**. Why do you want to see it? – jonrsharpe Mar 01 '15 at 18:03

0 Answers0