Where can I get the source code of the __builtin__ module in python?

Where can I get the source code for a module embedded in python? I'm interested in version 2.6.x.

+3
source share
3 answers

For a Ubuntu-specific solution (although it should work on Debian, Mint and other related distributions), download the source and you will find bltinmodule.c there.

On my Ubuntu system, it is under my python source directory, i.e. .../python2.6-2.6.6/Python/bltinmodule.c

apt-get source xxx download the source for the specified package to a subdirectory of your current directory.

This should do the trick:

 apt-get source python2.6  
 view ./python2.6-2.6.6/Python/bltinmodule.c

If you do not want to use find, rebuild your location database with sudo updatedb, and then you can do locate bltintmodule.cto find the file.

+1

, Python, \Python - bltinmodule.c.

- C:\python\2.X\Python

CentOS ...

root@xenos ~> locate bltinmodule.c
/usr/src/debug/Python-2.5.1/Python/bltinmodule.c
/usr/src/debug/Python-2.6.4/Python/bltinmodule.c

, http://packages.ubuntu.com/dapper/python-dev

+4

The easiest way to find the source code for CPython is the web view of the Mercurial repository: http://hg.python.org/cpython/file/2.6/Python/bltinmodule.c

(Updated link for copy link in Mercurial, although security versions were released from SVN repo)

+4
source

Source: https://habr.com/ru/post/1789151/


All Articles