Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 1 | This is Python version 3.7.0 alpha 1 |
| 2 | ==================================== |
Guido van Rossum | 9144763 | 2000-04-11 17:11:09 +0000 | [diff] [blame] | 3 | |
Victor Stinner | c9b62b4 | 2017-02-13 16:57:30 +0100 | [diff] [blame] | 4 | .. image:: https://travis-ci.org/python/cpython.svg?branch=master |
| 5 | :alt: CPython build status on Travis CI |
| 6 | :target: https://travis-ci.org/python/cpython |
| 7 | |
| 8 | .. image:: https://codecov.io/gh/python/cpython/branch/master/graph/badge.svg |
| 9 | :alt: CPython code coverage on Codecov |
| 10 | :target: https://codecov.io/gh/python/cpython |
| 11 | |
Benjamin Peterson | f606e68 | 2011-12-31 22:42:26 -0600 | [diff] [blame] | 12 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, |
Benjamin Peterson | e527dd3 | 2017-01-01 22:04:13 -0600 | [diff] [blame] | 13 | 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights |
| 14 | reserved. |
Guido van Rossum | 4405cf3 | 2007-08-30 17:16:55 +0000 | [diff] [blame] | 15 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 16 | See the end of this file for further copyright and license information. |
| 17 | |
Mariatta | e32ec93 | 2017-02-25 08:59:26 -0800 | [diff] [blame] | 18 | General Information |
| 19 | ------------------- |
| 20 | |
| 21 | - Website: https://www.python.org |
| 22 | - Source code: https://github.com/python/cpython |
| 23 | - Issue tracker: https://bugs.python.org |
| 24 | - Documentation: https://docs.python.org |
Mariatta | 6329aea | 2017-02-25 11:49:38 -0800 | [diff] [blame] | 25 | - Developer's Guide: https://docs.python.org/devguide/ |
Mariatta | e32ec93 | 2017-02-25 08:59:26 -0800 | [diff] [blame] | 26 | |
Nick Coghlan | 1b3d88e | 2017-02-18 12:01:47 +0530 | [diff] [blame] | 27 | Contributing to CPython |
| 28 | ----------------------- |
| 29 | |
| 30 | For more complete instructions on contributing to CPython development, |
| 31 | see the `Developer Guide`_. |
| 32 | |
| 33 | .. _Developer Guide: https://docs.python.org/devguide/ |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 34 | |
Ned Batchelder | 3cdbd68 | 2017-02-13 12:05:47 -0500 | [diff] [blame] | 35 | Using Python |
| 36 | ------------ |
| 37 | |
| 38 | Installable Python kits, and information about using Python, are available at |
| 39 | `python.org`_. |
| 40 | |
| 41 | .. _python.org: https://www.python.org/ |
| 42 | |
Evan Klitzke | 6db764a | 2017-02-27 22:32:07 -0800 | [diff] [blame^] | 43 | .. contents:: |
Guido van Rossum | 50e9fb9 | 2006-08-17 05:42:55 +0000 | [diff] [blame] | 44 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 45 | Build Instructions |
| 46 | ------------------ |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 47 | |
Paul Schreiber | c086685 | 2017-02-20 08:08:59 -0500 | [diff] [blame] | 48 | On Unix, Linux, BSD, macOS, and Cygwin:: |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 49 | |
| 50 | ./configure |
| 51 | make |
| 52 | make test |
| 53 | sudo make install |
| 54 | |
| 55 | This will install Python as python3. |
| 56 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 57 | You can pass many options to the configure script; run ``./configure --help`` |
Paul Schreiber | c086685 | 2017-02-20 08:08:59 -0500 | [diff] [blame] | 58 | to find out more. On macOS and Cygwin, the executable is called ``python.exe``; |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 59 | elsewhere it's just ``python``. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 60 | |
Paul Schreiber | c086685 | 2017-02-20 08:08:59 -0500 | [diff] [blame] | 61 | On macOS, if you have configured Python with ``--enable-framework``, you |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 62 | should use ``make frameworkinstall`` to do the installation. Note that this |
| 63 | installs the Python executable in a place that is not normally on your PATH, |
| 64 | you may want to set up a symlink in ``/usr/local/bin``. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 65 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 66 | On Windows, see `PCbuild/readme.txt |
| 67 | <https://github.com/python/cpython/blob/master/PCbuild/readme.txt>`_. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 68 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 69 | If you wish, you can create a subdirectory and invoke configure from there. |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 70 | For example:: |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 71 | |
| 72 | mkdir debug |
| 73 | cd debug |
| 74 | ../configure --with-pydebug |
| 75 | make |
| 76 | make test |
| 77 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 78 | (This will fail if you *also* built at the top-level directory. You should do |
| 79 | a ``make clean`` at the toplevel first.) |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 80 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 81 | To get an optimized build of Python, ``configure --enable-optimizations`` |
| 82 | before you run ``make``. This sets the default make targets up to enable |
| 83 | Profile Guided Optimization (PGO) and may be used to auto-enable Link Time |
| 84 | Optimization (LTO) on some platforms. For more details, see the sections |
| 85 | below. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 86 | |
| 87 | |
| 88 | Profile Guided Optimization |
Evan Klitzke | 6db764a | 2017-02-27 22:32:07 -0800 | [diff] [blame^] | 89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 90 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 91 | PGO takes advantage of recent versions of the GCC or Clang compilers. If ran, |
| 92 | ``make profile-opt`` will do several steps. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 93 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 94 | First, the entire Python directory is cleaned of temporary files that may have |
| 95 | resulted in a previous compilation. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 96 | |
| 97 | Then, an instrumented version of the interpreter is built, using suitable |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 98 | compiler flags for each flavour. Note that this is just an intermediary step |
| 99 | and the binary resulted after this step is not good for real life workloads, as |
| 100 | it has profiling instructions embedded inside. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 101 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 102 | After this instrumented version of the interpreter is built, the Makefile will |
| 103 | automatically run a training workload. This is necessary in order to profile |
| 104 | the interpreter execution. Note also that any output, both stdout and stderr, |
| 105 | that may appear at this step is suppressed. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 106 | |
| 107 | Finally, the last step is to rebuild the interpreter, using the information |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 108 | collected in the previous one. The end result will be a Python binary that is |
| 109 | optimized and suitable for distribution or production installation. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 110 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 111 | |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 014d52f | 2016-09-08 18:33:00 +0000 | [diff] [blame] | 112 | Link Time Optimization |
Evan Klitzke | 6db764a | 2017-02-27 22:32:07 -0800 | [diff] [blame^] | 113 | ^^^^^^^^^^^^^^^^^^^^^^ |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 014d52f | 2016-09-08 18:33:00 +0000 | [diff] [blame] | 114 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 115 | Enabled via configure's ``--with-lto`` flag. LTO takes advantage of the |
| 116 | ability of recent compiler toolchains to optimize across the otherwise |
| 117 | arbitrary ``.o`` file boundary when building final executables or shared |
| 118 | libraries for additional performance gains. |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 014d52f | 2016-09-08 18:33:00 +0000 | [diff] [blame] | 119 | |
| 120 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 121 | What's New |
| 122 | ---------- |
| 123 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 124 | We have a comprehensive overview of the changes in the `What's New in Python |
| 125 | 3.7 <https://docs.python.org/3.7/whatsnew/3.7.html>`_ document. For a more |
| 126 | detailed change log, read `Misc/NEWS |
| 127 | <https://github.com/python/cpython/blob/master/Misc/NEWS>`_, but a full |
| 128 | accounting of changes can only be gleaned from the `commit history |
| 129 | <https://github.com/python/cpython/commits/master>`_. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 130 | |
| 131 | If you want to install multiple versions of Python see the section below |
| 132 | entitled "Installing multiple versions". |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 133 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 134 | |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 135 | Documentation |
| 136 | ------------- |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 137 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 138 | `Documentation for Python 3.7 <https://docs.python.org/3.7/>`_ is online, |
| 139 | updated daily. |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 140 | |
Georg Brandl | 62069d3 | 2010-07-31 08:56:11 +0000 | [diff] [blame] | 141 | It can also be downloaded in many formats for faster access. The documentation |
| 142 | is downloadable in HTML, PDF, and reStructuredText formats; the latter version |
| 143 | is primarily for documentation authors, translators, and people with special |
| 144 | formatting requirements. |
Benjamin Peterson | 2a691a8 | 2008-03-31 01:51:45 +0000 | [diff] [blame] | 145 | |
Roger | b3f1f59 | 2017-02-15 17:54:05 -0500 | [diff] [blame] | 146 | For information about building Python's documentation, refer to `Doc/README.rst |
| 147 | <https://github.com/python/cpython/blob/master/Doc/README.rst>`_. |
Ezio Melotti | 802bf8a | 2013-08-16 21:32:25 +0300 | [diff] [blame] | 148 | |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 149 | |
Barry Warsaw | 97f005d | 2008-12-03 16:46:14 +0000 | [diff] [blame] | 150 | Converting From Python 2.x to 3.x |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 151 | --------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 152 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 153 | Significant backward incompatible changes were made for the release of Python |
| 154 | 3.0, which may cause programs written for Python 2 to fail when run with Python |
| 155 | 3. For more information about porting your code from Python 2 to Python 3, see |
| 156 | the `Porting HOWTO <https://docs.python.org/3/howto/pyporting.html>`_. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 157 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 158 | |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 159 | Testing |
| 160 | ------- |
| 161 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 162 | To test the interpreter, type ``make test`` in the top-level directory. The |
| 163 | test set produces some output. You can generally ignore the messages about |
| 164 | skipped tests due to optional features which can't be imported. If a message |
| 165 | is printed about a failed test or a traceback or core dump is produced, |
| 166 | something is wrong. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 167 | |
| 168 | By default, tests are prevented from overusing resources like disk space and |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 169 | memory. To enable these tests, run ``make testall``. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 170 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 171 | If any tests fail, you can re-run the failing test(s) in verbose mode:: |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 172 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 173 | make test TESTOPTS="-v test_that_failed" |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 174 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 175 | If the failure persists and appears to be a problem with Python rather than |
| 176 | your environment, you can `file a bug report <https://bugs.python.org>`_ and |
| 177 | include relevant output from that command to show the issue. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 178 | |
| 179 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 180 | Installing multiple versions |
| 181 | ---------------------------- |
| 182 | |
| 183 | On Unix and Mac systems if you intend to install multiple versions of Python |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 184 | using the same installation prefix (``--prefix`` argument to the configure |
| 185 | script) you must take care that your primary python executable is not |
| 186 | overwritten by the installation of a different version. All files and |
| 187 | directories installed using ``make altinstall`` contain the major and minor |
| 188 | version and can thus live side-by-side. ``make install`` also creates |
| 189 | ``${prefix}/bin/python3`` which refers to ``${prefix}/bin/pythonX.Y``. If you |
| 190 | intend to install multiple versions using the same prefix you must decide which |
| 191 | version (if any) is your "primary" version. Install that version using ``make |
| 192 | install``. Install all other versions using ``make altinstall``. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 193 | |
Ned Deily | 190042a | 2016-12-23 04:10:46 -0500 | [diff] [blame] | 194 | For example, if you want to install Python 2.7, 3.6, and 3.7 with 3.7 being the |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 195 | primary version, you would execute ``make install`` in your 3.7 build directory |
| 196 | and ``make altinstall`` in the others. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 197 | |
| 198 | |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 199 | Issue Tracker and Mailing List |
| 200 | ------------------------------ |
Michael W. Hudson | 71dcc3e | 2005-02-22 15:33:26 +0000 | [diff] [blame] | 201 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 202 | Bug reports are welcome! You can use the `issue tracker |
| 203 | <https://bugs.python.org>`_ to report bugs, and/or submit pull requests `on |
| 204 | GitHub <https://github.com/python/cpython>`_. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 205 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 206 | You can also follow development discussion on the `python-dev mailing list |
| 207 | <https://mail.python.org/mailman/listinfo/python-dev/>`_. |
Georg Brandl | 81299ad | 2006-02-20 10:24:06 +0000 | [diff] [blame] | 208 | |
Michael W. Hudson | 71dcc3e | 2005-02-22 15:33:26 +0000 | [diff] [blame] | 209 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 210 | Proposals for enhancement |
| 211 | ------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 212 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 213 | If you have a proposal to change Python, you may want to send an email to the |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 214 | comp.lang.python or `python-ideas`_ mailing lists for initial feedback. A |
| 215 | Python Enhancement Proposal (PEP) may be submitted if your idea gains ground. |
| 216 | All current PEPs, as well as guidelines for submitting a new PEP, are listed at |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 217 | `python.org/dev/peps/ <https://www.python.org/dev/peps/>`_. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 218 | |
Ned Batchelder | 3cdbd68 | 2017-02-13 12:05:47 -0500 | [diff] [blame] | 219 | .. _python-ideas: https://mail.python.org/mailman/listinfo/python-ideas/ |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 220 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 221 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 222 | Release Schedule |
| 223 | ---------------- |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 224 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 225 | See :pep:`537` for Python 3.7 release details. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 226 | |
| 227 | |
| 228 | Copyright and License Information |
| 229 | --------------------------------- |
| 230 | |
Georg Brandl | a7d2f00 | 2013-03-23 16:06:13 +0100 | [diff] [blame] | 231 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, |
Benjamin Peterson | f1dcdd9 | 2016-01-01 11:53:14 -0600 | [diff] [blame] | 232 | 2012, 2013, 2014, 2015, 2016 Python Software Foundation. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 233 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 234 | Copyright (c) 2000 BeOpen.com. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 235 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 236 | Copyright (c) 1995-2001 Corporation for National Research Initiatives. All |
| 237 | rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 238 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 239 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 240 | |
Zachary Ware | d50f188 | 2017-02-13 22:01:03 -0600 | [diff] [blame] | 241 | See the file "LICENSE" for information on the history of this software, terms & |
| 242 | conditions for usage, and a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 243 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 244 | This Python distribution contains *no* GNU General Public License (GPL) code, |
| 245 | so it may be used in proprietary projects. There are interfaces to some GNU |
| 246 | code but these are entirely optional. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 247 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 248 | All trademarks referenced herein are property of their respective holders. |