0

I was thinking about pre-made functions, and I was asking myself how some functions are written. So is there any database where I can find how functions were written?

My aim is to know how functions were built to get a better understanding of them. The function that I want to know how is it written is the sorted function, but in case I need to know others, a way to get the functions' script is highly necessary.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • http://en.wikipedia.org/wiki/Timsort – konart Jun 08 '15 at 13:07
  • For CPython, you'll find a lot of the code for sorting lists [here](https://hg.python.org/cpython/file/d8f48717b74e/Objects/listobject.c#l958). It's quite an involved piece of work. You can also find supporting notes describing the algorithm and its implementation [here](https://hg.python.org/cpython/file/d8f48717b74e/Objects/listsort.txt). – Alex Riley Jun 08 '15 at 13:07
  • Here: https://github.com/python/cpython/blob/master/Objects/listobject.c#L1904 – David K. Hess Jun 08 '15 at 13:13
  • Thank you guys for all the answers, it helped. – Arnaud 'KaRn1zC' Jun 09 '15 at 11:38

0 Answers0