GitHub - python/cpython: The Python programming language · GitHub
https://github.com/python/cpython • 377 KB fetched
Open original page
GitHub - python/cpython: The Python programming language · GitHub
Skip to content
Navigation Menu
Sign in Appearance settings
* Platform
* AI CODE CREATION
* GitHub Copilot Write better code with AI
* GitHub Copilot app Direct agents from issue to merge
* MCP Registry Integrate external tools
* DEVELOPER WORKFLOWS
* Actions Automate any workflow
* Codespaces Instant dev environments
* Issues Plan and track work
* Code Review Manage code changes
* Code Quality Enforce quality at merge
* APPLICATION SECURITY
* GitHub Advanced Security Find and fix vulnerabilities
* Code security Secure your code as you build
* Secret protection Stop leaks before they start
* EXPLORE
* Why GitHub
* Documentation
* Blog
* Changelog
* Marketplace
View all features
* Solutions
* BY COMPANY SIZE
* Enterprises
* Small and medium teams
* Startups
* Nonprofits
* BY USE CASE
* App Modernization
* DevSecOps
* DevOps
* CI/CD
* View all use cases
* BY INDUSTRY
* Healthcare
* Financial services
* Manufacturing
* Government
* View all industries
View all solutions
* Resources
* EXPLORE BY TOPIC
* AI
* Software Development
* DevOps
* Security
* View all topics
* EXPLORE BY TYPE
* Customer stories
* Events & webinars
* Ebooks & reports
* Business insights
* GitHub Skills
* SUPPORT & SERVICES
* Documentation
* Customer support
* Community forum
* Trust center
* Partners
View all resources
* Open Source
* COMMUNITY
* GitHub Sponsors Fund open source developers
* PROGRAMS
* Security Lab
* Maintainer Community
* GitHub Stars
* Archive Program
* REPOSITORIES
* Topics
* Trending
* Collections
* Enterprise
* ENTERPRISE SOLUTIONS
* Enterprise platform AI-powered developer platform
* AVAILABLE ADD-ONS
* GitHub Advanced Security Enterprise-grade security features
* Copilot for Business Enterprise-grade AI features
* Premium Support Enterprise-grade 24/7 support
* Pricing
Search /
Sign in
Sign up Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
Uh oh!
There was an error while loading. Please reload this page .
python
/
cpython
Public
*
Uh oh!
There was an error while loading. Please reload this page .
*
Notifications
You must be signed in to change notification settings
*
Fork
35.4k
*
Star
76.8k
*
Code
*
Issues
5k+
*
Pull requests
2.6k
*
Actions
*
Projects
*
Security and quality
0
*
Insights
Additional navigation options
*
Code
*
Issues
*
Pull requests
*
Actions
*
Projects
*
Security and quality
*
Insights
main
Branches Tags
Go to file
Code Open more actions menu
Latest commit
History
133,096 Commits
133,096 Commits
Folders and files
Name Name Last commit message
Last commit date
.azure-pipelines
.azure-pipelines
.claude
.claude
.devcontainer
.devcontainer
.github
.github
.well-known
.well-known
Doc
Doc
Grammar
Grammar
Include
Include
InternalDocs
InternalDocs
Lib
Lib
Mac
Mac
Misc
Misc
Modules
Modules
Objects
Objects
PC
PC
PCbuild
PCbuild
Parser
Parser
Platforms
Platforms
Programs
Programs
Python
Python
Tools
Tools
.coveragerc
.coveragerc
.editorconfig
.editorconfig
.gitattributes
.gitattributes
.gitignore
.gitignore
.mailmap
.mailmap
.pre-commit-config.yaml
.pre-commit-config.yaml
.readthedocs.yml
.readthedocs.yml
.ruff.toml
.ruff.toml
AGENTS.md
AGENTS.md
LICENSE
LICENSE
Makefile.pre.in
Makefile.pre.in
README.rst
README.rst
aclocal.m4
aclocal.m4
config.guess
config.guess
config.sub
config.sub
configure
configure
configure.ac
configure.ac
install-sh
install-sh
pyconfig.h.in
pyconfig.h.in
View all files
Repository files navigation
*
* README
* Code of conduct
* Contributing
* License
* Security
More items
This is Python version 3.16.0 alpha 0
Copyright © 2001 Python Software Foundation. All rights reserved.
See the end of this file for further copyright and license information.
Contents
* General Information
* Contributing to CPython
* Using Python
* Build Instructions
* Profile Guided Optimization
* Link Time Optimization
* What's New
* Documentation
* Testing
* Installing multiple versions
* Release Schedule
* Copyright and License Information
General Information
* Website: https://www.python.org
* Source code: https://github.com/python/cpython
* Issue tracker: https://github.com/python/cpython/issues
* Documentation: https://docs.python.org
* Developer's Guide: https://devguide.python.org/
Contributing to CPython
For more complete instructions on contributing to CPython development,
see the Developer Guide .
Using Python
Installable Python kits, and information about using Python, are available at
python.org .
Build Instructions
On Unix, Linux, BSD, macOS, and Cygwin:
./configure
make
make test
sudo make install
This will install Python as python3 .
You can pass many options to the configure script; run ./configure --help
to find out more. On macOS case-insensitive file systems and on Cygwin,
the executable is called python.exe ; elsewhere it's just python .
Building a complete Python installation requires the use of various
additional third-party libraries, depending on your build platform and
configure options. Not all standard library modules are buildable or
usable on all platforms. Refer to the
Install dependencies
section of the Developer Guide for current detailed information on
dependencies for various Linux distributions and macOS.
On macOS, there are additional configure and build options related
to macOS framework and universal builds. Refer to Mac/README.rst .
On Windows, see PCbuild/readme.txt .
To build Windows packages, see PC/layout/README.md .
If you wish, you can create a subdirectory and invoke configure from there.
For example:
mkdir debug
cd debug
../configure --with-pydebug
make
make test
(This will fail if you also built at the top-level directory. You should do
a make clean at the top-level first.)
To get an optimized build of Python, run configure --enable-optimizations
before you run make . This sets the default make targets up to enable
Profile Guided Optimization (PGO) and may be used to auto-enable Link Time
Optimization (LTO) on some platforms. For more details, see the sections
below.
Profile Guided Optimization
PGO takes advantage of recent versions of the GCC or Clang compilers. If used,
either via configure --enable-optimizations or by manually running
make profile-opt regardless of configure flags, the optimized build
process will perform the following steps:
The entire Python directory is cleaned of temporary files that may have
resulted from a previous compilation.
An instrumented version of the interpreter is built, using suitable compiler
flags for each flavor. Note that this is just an intermediary step. The
binary resulting from this step is not good for real-life workloads as it has
profiling instructions embedded inside.
After the instrumented interpreter is built, the Makefile will run a training
workload. This is necessary in order to profile the interpreter's execution.
Note also that any output, both stdout and stderr, that may appear at this step
is suppressed.
The final step is to build the actual interpreter, using the information
collected from the instrumented one. The end result will be a Python binary
that is optimized; suitable for distribution or production installation.
Link Time Optimization
Enabled via configure's --with-lto flag. LTO takes advantage of the
ability of recent compiler toolchains to optimize across the otherwise
arbitrary .o file boundary when building final executables or shared
libraries for additional performance gains.
What's New
We have a comprehensive overview of the changes in the What's new in Python
3.16 document. For a more
detailed change log, read Misc/NEWS , but a full
accounting of changes can only be gleaned from the commit history .
If you want to install multiple versions of Python, see the section below
entitled "Installing multiple versions".
Documentation
Documentation for Python 3.16 is online,
updated daily.
It can also be downloaded in many formats for faster access. The documentation
is downloadable in HTML, EPUB, and reStructuredText formats; the latter version
is primarily for documentation authors, translators, and people with special
formatting requirements.
For information about building Python's documentation, refer to Doc/README.rst .
Testing
To test the interpreter, type make test in the top-level directory. The
test set produces some output. You can generally ignore the messages about
skipped tests due to optional features which can't be imported. If a message
is printed about a failed test or a traceback or core dump is produced,
something is wrong.
By default, tests are prevented from overusing resources like disk space and
memory. To enable these tests, run make buildbottest .
If any tests fail, you can re-run the failing test(s) in verbose mode. For
example, if test_os and test_gdb failed, you can run:
make test TESTOPTS="-v test_os test_gdb"
If the failure persists and appears to be a problem with Python rather than
your environment, you can file a bug report and include relevant output from
that command to show the issue.
See Running & Writing Tests
for more on running tests.
Installing multiple versions
On Unix and Mac systems if you intend to install multiple versions of Python
using the same installation prefix ( --prefix argument to the configure
script) you must take care that your primary python executable is not
overwritten by the installation of a different version. All files and
directories installed using make altinstall contain the major and minor
version and can thus live side-by-side. make install also creates
${prefix}/bin/python3 which refers to ${prefix}/bin/python3.X . If you
intend to install multiple versions using the same prefix you must decide which
version (if any) is your "primary" version. Install that version using
make install . Install all other versions using make altinstall .
For example, if you want to install Python 2.7, 3.6, and 3.15 with 3.15 being the
primary version, you would execute make install in your 3.15 build directory
and make altinstall in the others.
Release Schedule
See PEP 826 for Python 3.16 release details.
Copyright and License Information
Copyright © 2001 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2001 Corporation for National Research Initiatives. All
rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
See the LICENSE for
information on the history of this software, terms & conditions for usage, and a
DISCLAIMER OF ALL WARRANTIES.
This Python distribution contains no GNU General Public License (GPL) code,
so it may be used in proprietary projects. There are interfaces to some GNU
code but these are entirely optional.
All trademarks referenced herein are property of their respective holders.
About
The Python programming language
www.python.org
Resources
Readme
License
Code of conduct
Code of conduct
Contributing
Contributing
Security policy
Security policy
Activity
Custom properties
Stars
76.8k stars
Watchers
1.6k watching
Forks
35.4k forks
Report repository
Releases
Sponsor this project
Packages
Used by
Contributors
Languages
Footer
(c) 2026 GitHub, Inc.
Footer navigation
*
Terms
*
Privacy
*
Security
*
Status
*
Community
*
Docs
*
Contact
*
Manage cookies
*
Do not share my personal information
You can’t perform that action at this time.
Links found on this page
- Skip to content [direct]
- Sign in [direct]
- GitHub Copilot Write better code with AI [direct]
- GitHub Copilot app Direct agents from issue to merge [direct]
- MCP Registry Integrate external tools [direct]
- Actions Automate any workflow [direct]
- Codespaces Instant dev environments [direct]
- Issues Plan and track work [direct]
- Code Review Manage code changes [direct]
- Code Quality Enforce quality at merge [direct]
- GitHub Advanced Security Find and fix vulnerabilities [direct]
- Code security Secure your code as you build [direct]
- Secret protection Stop leaks before they start [direct]
- Why GitHub [direct]
- Documentation [direct]
- Blog [direct]
- Changelog [direct]
- Marketplace [direct]
- View all features [direct]
- Enterprises [direct]
- Small and medium teams [direct]
- Startups [direct]
- Nonprofits [direct]
- App Modernization [direct]
- DevSecOps [direct]
- DevOps [direct]
- CI/CD [direct]
- View all use cases [direct]
- Healthcare [direct]
- Financial services [direct]
- Manufacturing [direct]
- Government [direct]
- View all industries [direct]
- View all solutions [direct]
- AI [direct]
- Software Development [direct]
- DevOps [direct]
- Security [direct]
- View all topics [direct]
- Customer stories [direct]
- Events & webinars [direct]
- Ebooks & reports [direct]
- Business insights [direct]
- GitHub Skills [direct]
- Customer support [direct]
- Community forum [direct]
- Trust center [direct]
- Partners [direct]
- View all resources [direct]
- GitHub Sponsors Fund open source developers [direct]
- Security Lab [direct]
- Maintainer Community [direct]
- GitHub Stars [direct]
- Archive Program [direct]
- Topics [direct]
- Trending [direct]
- Collections [direct]
- Copilot for Business Enterprise-grade AI features [direct]
- Premium Support Enterprise-grade 24/7 support [direct]
- Pricing [direct]
- Sign up [direct]
- python [direct]
- Notifications [direct]
- Issues
5k+ [direct]
- Pull requests
2.6k [direct]
- Actions [direct]
- Projects [direct]
- Security and quality
0 [direct]
- Insights [direct]
- Branches [direct]
- Tags [direct]
- 133,096 Commits [direct]
- .azure-pipelines [direct]
- .claude [direct]
- .devcontainer [direct]
- .github [direct]
- .well-known [direct]
- Doc [direct]
- Grammar [direct]
- Include [direct]