Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source code for Python's modules

Tags:

python

Is it possible to view the source code of Python's functions like sum, zip and the like? I just want to know about the implementation.

Thanks.

like image 249
bdhar Avatar asked Feb 17 '12 06:02

bdhar


3 Answers

You can download it here:

http://www.python.org/getit/source/

like image 134
wim Avatar answered Nov 15 '22 08:11

wim


Source for builtins functions (like sum, zip, etc) are in http://hg.python.org/cpython/file/57c157be847f/Python/bltinmodule.c.

like image 36
neizod Avatar answered Nov 15 '22 08:11

neizod


You cant see the code for the sum and zip because those are wrapper of c functions. But other module you can check on http://hg.python.org/cpython/file/2.7/Lib

like image 40
Nilesh Avatar answered Nov 15 '22 07:11

Nilesh