blob: 48376362ecfa12383ab2916165748b4b967fb19c [file] [log] [blame]
Łukasz Langa34214de2019-10-01 14:58:26 +02001This is Python version 3.8.0 release candidate 1
2================================================
Guido van Rossum91447632000-04-11 17:11:09 +00003
Zachary Ware50290e32019-10-11 11:30:03 -05004.. image:: https://travis-ci.org/python/cpython.svg?branch=3.8
Victor Stinnerc9b62b42017-02-13 16:57:30 +01005 :alt: CPython build status on Travis CI
Zachary Ware50290e32019-10-11 11:30:03 -05006 :target: https://travis-ci.org/python/cpython/branches
Victor Stinnerc9b62b42017-02-13 16:57:30 +01007
Zachary Ware50290e32019-10-11 11:30:03 -05008.. image:: https://dev.azure.com/python/cpython/_apis/build/status/Azure%20Pipelines%20CI?branchName=3.8
Steve Dower680d26e2018-09-24 08:04:33 -04009 :alt: CPython build status on Azure DevOps
Zachary Ware50290e32019-10-11 11:30:03 -050010 :target: https://dev.azure.com/python/cpython/_build/latest?definitionId=4&branchName=3.8
Steve Dower757b73c2018-08-31 08:11:35 -070011
Zachary Ware50290e32019-10-11 11:30:03 -050012.. image:: https://codecov.io/gh/python/cpython/branch/3.8/graph/badge.svg
Victor Stinnerc9b62b42017-02-13 16:57:30 +010013 :alt: CPython code coverage on Codecov
Zachary Ware50290e32019-10-11 11:30:03 -050014 :target: https://codecov.io/gh/python/cpython/branch/3.8
Victor Stinnerc9b62b42017-02-13 16:57:30 +010015
Mariattab57eea12018-06-29 13:43:45 -070016.. image:: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
17 :alt: Python Zulip chat
18 :target: https://python.zulipchat.com
Steve Dower757b73c2018-08-31 08:11:35 -070019
Mariattab57eea12018-06-29 13:43:45 -070020
Benjamin Peterson9a69ae82019-01-02 07:46:53 -080021Copyright (c) 2001-2019 Python Software Foundation. All rights reserved.
Guido van Rossum4405cf32007-08-30 17:16:55 +000022
Zachary Wared50f1882017-02-13 22:01:03 -060023See the end of this file for further copyright and license information.
24
INADA Naoki7c8b3fa2017-02-28 16:26:58 +090025.. contents::
26
Mariattae32ec932017-02-25 08:59:26 -080027General Information
28-------------------
29
30- Website: https://www.python.org
31- Source code: https://github.com/python/cpython
32- Issue tracker: https://bugs.python.org
33- Documentation: https://docs.python.org
Lisa Hewus Fresh384899d2017-08-30 09:37:43 -070034- Developer's Guide: https://devguide.python.org/
Mariattae32ec932017-02-25 08:59:26 -080035
Nick Coghlan1b3d88e2017-02-18 12:01:47 +053036Contributing to CPython
37-----------------------
38
39For more complete instructions on contributing to CPython development,
40see the `Developer Guide`_.
41
Lisa Hewus Fresh384899d2017-08-30 09:37:43 -070042.. _Developer Guide: https://devguide.python.org/
Guido van Rossum1c896e32007-08-29 23:03:30 +000043
Ned Batchelder3cdbd682017-02-13 12:05:47 -050044Using Python
45------------
46
47Installable Python kits, and information about using Python, are available at
48`python.org`_.
49
50.. _python.org: https://www.python.org/
51
Benjamin Peterson1da43e52009-06-26 13:21:52 +000052Build Instructions
53------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000054
Paul Schreiberc0866852017-02-20 08:08:59 -050055On Unix, Linux, BSD, macOS, and Cygwin::
Benjamin Peterson1da43e52009-06-26 13:21:52 +000056
57 ./configure
58 make
59 make test
60 sudo make install
61
Suriyaa ✌️️7e3fb402019-01-02 02:57:42 +010062This will install Python as ``python3``.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000063
Zachary Wared50f1882017-02-13 22:01:03 -060064You can pass many options to the configure script; run ``./configure --help``
Paul Schreiberc0866852017-02-20 08:08:59 -050065to find out more. On macOS and Cygwin, the executable is called ``python.exe``;
Victor Stinnerd783b012017-02-11 02:21:38 +010066elsewhere it's just ``python``.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000067
atg7000ee994d72018-06-07 19:33:20 -070068If you are running on macOS with the latest updates installed, make sure to install
Hossein Pourbozorg5f2b3b02019-05-02 12:47:55 +043069OpenSSL or some other SSL software along with Homebrew or another package manager.
Łukasz Langae75eeb02019-02-03 14:17:38 +010070If issues persist, see https://devguide.python.org/setup/#macos-and-os-x for more
71information.
atg7000ee994d72018-06-07 19:33:20 -070072
Paul Schreiberc0866852017-02-20 08:08:59 -050073On macOS, if you have configured Python with ``--enable-framework``, you
Zachary Wared50f1882017-02-13 22:01:03 -060074should use ``make frameworkinstall`` to do the installation. Note that this
75installs the Python executable in a place that is not normally on your PATH,
76you may want to set up a symlink in ``/usr/local/bin``.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000077
Zachary Wared50f1882017-02-13 22:01:03 -060078On Windows, see `PCbuild/readme.txt
79<https://github.com/python/cpython/blob/master/PCbuild/readme.txt>`_.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000080
Larry Hastingsf92f6c82015-09-12 17:28:39 +010081If you wish, you can create a subdirectory and invoke configure from there.
Victor Stinnerd783b012017-02-11 02:21:38 +010082For example::
Benjamin Peterson1da43e52009-06-26 13:21:52 +000083
84 mkdir debug
85 cd debug
86 ../configure --with-pydebug
87 make
88 make test
89
Zachary Wared50f1882017-02-13 22:01:03 -060090(This will fail if you *also* built at the top-level directory. You should do
Hossein Pourbozorg5f2b3b02019-05-02 12:47:55 +043091a ``make clean`` at the top-level first.)
Benjamin Peterson1da43e52009-06-26 13:21:52 +000092
Zachary Wared50f1882017-02-13 22:01:03 -060093To get an optimized build of Python, ``configure --enable-optimizations``
94before you run ``make``. This sets the default make targets up to enable
95Profile Guided Optimization (PGO) and may be used to auto-enable Link Time
96Optimization (LTO) on some platforms. For more details, see the sections
97below.
Brett Cannon7188a3e2015-09-18 15:13:44 -070098
99
100Profile Guided Optimization
Evan Klitzke6db764a2017-02-27 22:32:07 -0800101^^^^^^^^^^^^^^^^^^^^^^^^^^^
Brett Cannon7188a3e2015-09-18 15:13:44 -0700102
Gregory P. Smithb87c1c92018-04-19 08:58:17 -0700103PGO takes advantage of recent versions of the GCC or Clang compilers. If used,
Gregory P. Smith93f9a8a2018-05-16 10:34:47 -0500104either via ``configure --enable-optimizations`` or by manually running
105``make profile-opt`` regardless of configure flags, the optimized build
106process will perform the following steps:
Brett Cannon7188a3e2015-09-18 15:13:44 -0700107
Gregory P. Smith93f9a8a2018-05-16 10:34:47 -0500108The entire Python directory is cleaned of temporary files that may have
109resulted from a previous compilation.
Brett Cannon7188a3e2015-09-18 15:13:44 -0700110
Gregory P. Smith93f9a8a2018-05-16 10:34:47 -0500111An instrumented version of the interpreter is built, using suitable compiler
112flags for each flavour. Note that this is just an intermediary step. The
113binary resulting from this step is not good for real life workloads as it has
114profiling instructions embedded inside.
Brett Cannon7188a3e2015-09-18 15:13:44 -0700115
Gregory P. Smith93f9a8a2018-05-16 10:34:47 -0500116After the instrumented interpreter is built, the Makefile will run a training
117workload. This is necessary in order to profile the interpreter execution.
118Note also that any output, both stdout and stderr, that may appear at this step
119is suppressed.
Brett Cannon7188a3e2015-09-18 15:13:44 -0700120
Gregory P. Smith93f9a8a2018-05-16 10:34:47 -0500121The final step is to build the actual interpreter, using the information
122collected from the instrumented one. The end result will be a Python binary
123that is optimized; suitable for distribution or production installation.
Brett Cannon7188a3e2015-09-18 15:13:44 -0700124
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000125
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +0000126Link Time Optimization
Evan Klitzke6db764a2017-02-27 22:32:07 -0800127^^^^^^^^^^^^^^^^^^^^^^
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +0000128
Zachary Wared50f1882017-02-13 22:01:03 -0600129Enabled via configure's ``--with-lto`` flag. LTO takes advantage of the
130ability of recent compiler toolchains to optimize across the otherwise
131arbitrary ``.o`` file boundary when building final executables or shared
132libraries for additional performance gains.
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +0000133
134
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000135What's New
136----------
137
Zachary Wared50f1882017-02-13 22:01:03 -0600138We have a comprehensive overview of the changes in the `What's New in Python
Ned Deily5489bda2018-01-31 17:44:09 -05001393.8 <https://docs.python.org/3.8/whatsnew/3.8.html>`_ document. For a more
Zachary Wared50f1882017-02-13 22:01:03 -0600140detailed change log, read `Misc/NEWS
Mariatta1b8f6122017-09-13 16:47:33 -0700141<https://github.com/python/cpython/blob/master/Misc/NEWS.d>`_, but a full
Zachary Wared50f1882017-02-13 22:01:03 -0600142accounting of changes can only be gleaned from the `commit history
143<https://github.com/python/cpython/commits/master>`_.
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000144
Hossein Pourbozorg5f2b3b02019-05-02 12:47:55 +0430145If you want to install multiple versions of Python, see the section below
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000146entitled "Installing multiple versions".
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000147
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000148
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000149Documentation
150-------------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000151
Ned Deily5489bda2018-01-31 17:44:09 -0500152`Documentation for Python 3.8 <https://docs.python.org/3.8/>`_ is online,
Victor Stinnerd783b012017-02-11 02:21:38 +0100153updated daily.
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000154
Georg Brandl62069d32010-07-31 08:56:11 +0000155It can also be downloaded in many formats for faster access. The documentation
156is downloadable in HTML, PDF, and reStructuredText formats; the latter version
157is primarily for documentation authors, translators, and people with special
158formatting requirements.
Benjamin Peterson2a691a82008-03-31 01:51:45 +0000159
Rogerb3f1f592017-02-15 17:54:05 -0500160For information about building Python's documentation, refer to `Doc/README.rst
161<https://github.com/python/cpython/blob/master/Doc/README.rst>`_.
Ezio Melotti802bf8a2013-08-16 21:32:25 +0300162
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000163
Barry Warsaw97f005d2008-12-03 16:46:14 +0000164Converting From Python 2.x to 3.x
Guido van Rossum1c896e32007-08-29 23:03:30 +0000165---------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000166
Zachary Wared50f1882017-02-13 22:01:03 -0600167Significant backward incompatible changes were made for the release of Python
1683.0, which may cause programs written for Python 2 to fail when run with Python
1693. For more information about porting your code from Python 2 to Python 3, see
170the `Porting HOWTO <https://docs.python.org/3/howto/pyporting.html>`_.
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000171
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000172
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000173Testing
174-------
175
Zachary Wared50f1882017-02-13 22:01:03 -0600176To test the interpreter, type ``make test`` in the top-level directory. The
177test set produces some output. You can generally ignore the messages about
178skipped tests due to optional features which can't be imported. If a message
179is printed about a failed test or a traceback or core dump is produced,
180something is wrong.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000181
182By default, tests are prevented from overusing resources like disk space and
Victor Stinnerd783b012017-02-11 02:21:38 +0100183memory. To enable these tests, run ``make testall``.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000184
Aaron Ang0f914b52018-04-09 14:09:31 -0700185If any tests fail, you can re-run the failing test(s) in verbose mode. For
186example, if ``test_os`` and ``test_gdb`` failed, you can run::
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000187
Aaron Ang0f914b52018-04-09 14:09:31 -0700188 make test TESTOPTS="-v test_os test_gdb"
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000189
Zachary Wared50f1882017-02-13 22:01:03 -0600190If the failure persists and appears to be a problem with Python rather than
191your environment, you can `file a bug report <https://bugs.python.org>`_ and
192include relevant output from that command to show the issue.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000193
Michael Osipovcae8ff92018-08-17 23:43:34 +0200194See `Running & Writing Tests <https://devguide.python.org/runtests/>`_
195for more on running tests.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000196
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000197Installing multiple versions
198----------------------------
199
200On Unix and Mac systems if you intend to install multiple versions of Python
Zachary Wared50f1882017-02-13 22:01:03 -0600201using the same installation prefix (``--prefix`` argument to the configure
202script) you must take care that your primary python executable is not
203overwritten by the installation of a different version. All files and
204directories installed using ``make altinstall`` contain the major and minor
205version and can thus live side-by-side. ``make install`` also creates
206``${prefix}/bin/python3`` which refers to ``${prefix}/bin/pythonX.Y``. If you
207intend to install multiple versions using the same prefix you must decide which
208version (if any) is your "primary" version. Install that version using ``make
209install``. Install all other versions using ``make altinstall``.
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000210
Ned Deily5489bda2018-01-31 17:44:09 -0500211For example, if you want to install Python 2.7, 3.6, and 3.8 with 3.8 being the
212primary version, you would execute ``make install`` in your 3.8 build directory
Victor Stinnerd783b012017-02-11 02:21:38 +0100213and ``make altinstall`` in the others.
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000214
215
Guido van Rossum1c896e32007-08-29 23:03:30 +0000216Issue Tracker and Mailing List
217------------------------------
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000218
Zachary Wared50f1882017-02-13 22:01:03 -0600219Bug reports are welcome! You can use the `issue tracker
220<https://bugs.python.org>`_ to report bugs, and/or submit pull requests `on
221GitHub <https://github.com/python/cpython>`_.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000222
Zachary Wared50f1882017-02-13 22:01:03 -0600223You can also follow development discussion on the `python-dev mailing list
224<https://mail.python.org/mailman/listinfo/python-dev/>`_.
Georg Brandl81299ad2006-02-20 10:24:06 +0000225
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000226
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000227Proposals for enhancement
228-------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000229
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000230If you have a proposal to change Python, you may want to send an email to the
Zachary Wared50f1882017-02-13 22:01:03 -0600231comp.lang.python or `python-ideas`_ mailing lists for initial feedback. A
232Python Enhancement Proposal (PEP) may be submitted if your idea gains ground.
233All current PEPs, as well as guidelines for submitting a new PEP, are listed at
Victor Stinnerd783b012017-02-11 02:21:38 +0100234`python.org/dev/peps/ <https://www.python.org/dev/peps/>`_.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000235
Ned Batchelder3cdbd682017-02-13 12:05:47 -0500236.. _python-ideas: https://mail.python.org/mailman/listinfo/python-ideas/
Guido van Rossum1c896e32007-08-29 23:03:30 +0000237
Zachary Wared50f1882017-02-13 22:01:03 -0600238
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000239Release Schedule
240----------------
Guido van Rossum1c896e32007-08-29 23:03:30 +0000241
Ned Deily5489bda2018-01-31 17:44:09 -0500242See :pep:`569` for Python 3.8 release details.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000243
244
245Copyright and License Information
246---------------------------------
247
Benjamin Peterson9a69ae82019-01-02 07:46:53 -0800248Copyright (c) 2001-2019 Python Software Foundation. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000249
Georg Brandl260a7882011-02-20 10:29:04 +0000250Copyright (c) 2000 BeOpen.com. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000251
Georg Brandl260a7882011-02-20 10:29:04 +0000252Copyright (c) 1995-2001 Corporation for National Research Initiatives. All
253rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000254
Georg Brandl260a7882011-02-20 10:29:04 +0000255Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000256
Zachary Wared50f1882017-02-13 22:01:03 -0600257See the file "LICENSE" for information on the history of this software, terms &
258conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000259
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100260This Python distribution contains *no* GNU General Public License (GPL) code,
261so it may be used in proprietary projects. There are interfaces to some GNU
262code but these are entirely optional.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000263
Georg Brandl260a7882011-02-20 10:29:04 +0000264All trademarks referenced herein are property of their respective holders.