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 | |
Benjamin Peterson | f606e68 | 2011-12-31 22:42:26 -0600 | [diff] [blame] | 4 | 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] | 5 | 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights |
| 6 | reserved. |
Guido van Rossum | 4405cf3 | 2007-08-30 17:16:55 +0000 | [diff] [blame] | 7 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 8 | Python 3.x is a new version of the language, which is incompatible with the |
| 9 | 2.x line of releases. The language is mostly the same, but many details, |
| 10 | especially how built-in objects like dictionaries and strings work, |
| 11 | have changed considerably, and a lot of deprecated features have finally |
| 12 | been removed. |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 13 | |
Guido van Rossum | 50e9fb9 | 2006-08-17 05:42:55 +0000 | [diff] [blame] | 14 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 15 | Build Instructions |
| 16 | ------------------ |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 17 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 18 | On Unix, Linux, BSD, OSX, and Cygwin:: |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 19 | |
| 20 | ./configure |
| 21 | make |
| 22 | make test |
| 23 | sudo make install |
| 24 | |
| 25 | This will install Python as python3. |
| 26 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 27 | You can pass many options to the configure script; run ``./configure --help`` to |
| 28 | find out more. On OSX and Cygwin, the executable is called ``python.exe``; |
| 29 | elsewhere it's just ``python``. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 30 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 31 | On Mac OS X, if you have configured Python with ``--enable-framework``, you should |
| 32 | use ``make frameworkinstall`` to do the installation. Note that this installs the |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 33 | Python executable in a place that is not normally on your PATH, you may want to |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 34 | set up a symlink in ``/usr/local/bin``. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 35 | |
| 36 | On Windows, see PCbuild/readme.txt. |
| 37 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 38 | 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] | 39 | For example:: |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 40 | |
| 41 | mkdir debug |
| 42 | cd debug |
| 43 | ../configure --with-pydebug |
| 44 | make |
| 45 | make test |
| 46 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 47 | (This will fail if you *also* built at the top-level directory. |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 48 | You should do a ``make clean`` at the toplevel first.) |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 49 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 50 | To get an optimized build of Python, ``configure --enable-optimizations`` before |
| 51 | you run ``make``. This sets the default make targets up to enable Profile Guided |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 14c7f71 | 2016-09-08 22:38:46 +0000 | [diff] [blame] | 52 | Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO) |
| 53 | on some platforms. For more details, see the sections bellow. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 54 | |
| 55 | |
| 56 | Profile Guided Optimization |
| 57 | --------------------------- |
| 58 | |
| 59 | PGO takes advantage of recent versions of the GCC or Clang compilers. |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 60 | If ran, ``make profile-opt`` will do several steps. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 61 | |
| 62 | First, the entire Python directory is cleaned of temporary files that |
Martin Panter | 8d56c02 | 2016-05-29 04:13:35 +0000 | [diff] [blame] | 63 | may have resulted in a previous compilation. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 64 | |
| 65 | Then, an instrumented version of the interpreter is built, using suitable |
| 66 | compiler flags for each flavour. Note that this is just an intermediary |
| 67 | step and the binary resulted after this step is not good for real life |
| 68 | workloads, as it has profiling instructions embedded inside. |
| 69 | |
| 70 | After this instrumented version of the interpreter is built, the Makefile |
| 71 | will automatically run a training workload. This is necessary in order to |
| 72 | profile the interpreter execution. Note also that any output, both stdout |
Raymond Hettinger | 15f44ab | 2016-08-30 10:47:49 -0700 | [diff] [blame] | 73 | and stderr, that may appear at this step is suppressed. |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 74 | |
| 75 | Finally, the last step is to rebuild the interpreter, using the information |
Martin Panter | cc71a79 | 2016-04-05 06:19:42 +0000 | [diff] [blame] | 76 | collected in the previous one. The end result will be a Python binary |
Brett Cannon | 7188a3e | 2015-09-18 15:13:44 -0700 | [diff] [blame] | 77 | that is optimized and suitable for distribution or production installation. |
| 78 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 79 | |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 014d52f | 2016-09-08 18:33:00 +0000 | [diff] [blame] | 80 | Link Time Optimization |
| 81 | ---------------------- |
| 82 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 83 | Enabled via configure's ``--with-lto`` flag. LTO takes advantages of recent |
| 84 | compiler toolchains ability to optimize across the otherwise arbitrary ``.o`` file |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 14c7f71 | 2016-09-08 22:38:46 +0000 | [diff] [blame] | 85 | boundary when building final executables or shared libraries for additional |
| 86 | performance gains. |
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) | 014d52f | 2016-09-08 18:33:00 +0000 | [diff] [blame] | 87 | |
| 88 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 89 | What's New |
| 90 | ---------- |
| 91 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 92 | We have a comprehensive overview of the changes in the `What's New in |
| 93 | Python 3.7 <https://docs.python.org/3.7/whatsnew/3.7.html>`_ document. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 94 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 95 | For a more detailed change log, read Misc/NEWS (though this file, too, |
| 96 | is incomplete, and also doesn't list anything merged in from the 2.7 |
| 97 | release under development). |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 98 | |
| 99 | If you want to install multiple versions of Python see the section below |
| 100 | entitled "Installing multiple versions". |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 101 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 102 | |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 103 | Documentation |
| 104 | ------------- |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 105 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 106 | `Documentation for Python 3.7 <https://docs.python.org/3.7/>`_ is online, |
| 107 | updated daily. |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 108 | |
Georg Brandl | 62069d3 | 2010-07-31 08:56:11 +0000 | [diff] [blame] | 109 | It can also be downloaded in many formats for faster access. The documentation |
| 110 | is downloadable in HTML, PDF, and reStructuredText formats; the latter version |
| 111 | is primarily for documentation authors, translators, and people with special |
| 112 | formatting requirements. |
Benjamin Peterson | 2a691a8 | 2008-03-31 01:51:45 +0000 | [diff] [blame] | 113 | |
Ezio Melotti | 802bf8a | 2013-08-16 21:32:25 +0300 | [diff] [blame] | 114 | If you would like to contribute to the development of Python, relevant |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 115 | documentation is available at: `Python Developer's Guide |
| 116 | <https://docs.python.org/devguide/>`_. |
Ezio Melotti | 802bf8a | 2013-08-16 21:32:25 +0300 | [diff] [blame] | 117 | |
| 118 | For information about building Python's documentation, refer to Doc/README.txt. |
| 119 | |
Guido van Rossum | c07d5fa | 2000-09-01 22:50:02 +0000 | [diff] [blame] | 120 | |
Barry Warsaw | 97f005d | 2008-12-03 16:46:14 +0000 | [diff] [blame] | 121 | Converting From Python 2.x to 3.x |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 122 | --------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 123 | |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 124 | Python starting with 2.6 contains features to help locating code that needs to |
| 125 | be changed, such as optional warnings when deprecated features are used, and |
| 126 | backported versions of certain key Python 3.x features. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 127 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 128 | A source-to-source translation tool, ``2to3``, can take care of the mundane task |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 129 | of converting large amounts of source code. It is not a complete solution but |
| 130 | is complemented by the deprecation warnings in 2.6. See |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 131 | `2to3 documentation <https://docs.python.org/3.7/library/2to3.html>`_ for more |
| 132 | information. |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 133 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 134 | |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 135 | Testing |
| 136 | ------- |
| 137 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 138 | To test the interpreter, type ``make test`` in the top-level directory. |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 139 | The test set produces some output. You can generally ignore the messages |
| 140 | about skipped tests due to optional features which can't be imported. |
| 141 | If a message is printed about a failed test or a traceback or core dump |
| 142 | is produced, something is wrong. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 143 | |
| 144 | By default, tests are prevented from overusing resources like disk space and |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 145 | memory. To enable these tests, run ``make testall``. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 146 | |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 147 | IMPORTANT: If the tests fail and you decide to mail a bug report, *don't* |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 148 | include the output of ``make test``. It is useless. Run the failing test |
| 149 | manually, as follows:: |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 150 | |
Antoine Pitrou | e7fed67 | 2010-12-14 22:06:10 +0000 | [diff] [blame] | 151 | ./python -m test -v test_whatever |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 152 | |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 153 | (substituting the top of the source tree for '.' if you built in a different |
| 154 | directory). This runs the test in verbose mode. |
Benjamin Peterson | ad3d5c2 | 2009-02-26 03:38:59 +0000 | [diff] [blame] | 155 | |
| 156 | |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 157 | Installing multiple versions |
| 158 | ---------------------------- |
| 159 | |
| 160 | On Unix and Mac systems if you intend to install multiple versions of Python |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 161 | using the same installation prefix (``--prefix`` argument to the configure script) |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 162 | you must take care that your primary python executable is not overwritten by the |
| 163 | installation of a different version. All files and directories installed using |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 164 | ``make altinstall`` contain the major and minor version and can thus live |
| 165 | side-by-side. ``make install`` also creates ``${prefix}/bin/python3`` which refers to |
| 166 | ``${prefix}/bin/pythonX.Y``. If you intend to install multiple versions using the |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 167 | same prefix you must decide which version (if any) is your "primary" version. |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 168 | Install that version using ``make install``. Install all other versions using |
| 169 | ``make altinstall``. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 170 | |
Ned Deily | 190042a | 2016-12-23 04:10:46 -0500 | [diff] [blame] | 171 | 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] | 172 | primary version, you would execute ``make install`` in your 3.7 build directory |
| 173 | and ``make altinstall`` in the others. |
Christian Heimes | dd15f6c | 2008-03-16 00:07:10 +0000 | [diff] [blame] | 174 | |
| 175 | |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 176 | Issue Tracker and Mailing List |
| 177 | ------------------------------ |
Michael W. Hudson | 71dcc3e | 2005-02-22 15:33:26 +0000 | [diff] [blame] | 178 | |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 179 | We're soliciting bug reports about all aspects of the language. Fixes are also |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 180 | welcome, preferably in unified diff format. Please use the issue tracker: |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 181 | `bugs.python.org <https://bugs.python.org/>`_. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 182 | |
Georg Brandl | a02607e | 2010-07-31 11:00:47 +0000 | [diff] [blame] | 183 | If you're not sure whether you're dealing with a bug or a feature, use the |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 184 | mailing list: python-dev@python.org. To subscribe to the list, use the mailman |
| 185 | form: `python-dev <https://mail.python.org/mailman/listinfo/python-dev/>`_ |
Georg Brandl | 81299ad | 2006-02-20 10:24:06 +0000 | [diff] [blame] | 186 | |
Michael W. Hudson | 71dcc3e | 2005-02-22 15:33:26 +0000 | [diff] [blame] | 187 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 188 | Proposals for enhancement |
| 189 | ------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 190 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 191 | If you have a proposal to change Python, you may want to send an email to the |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 192 | comp.lang.python or |
| 193 | `python-ideas <https://mail.python.org/mailman/listinfo/python-ideas/>`_ |
| 194 | mailing lists for initial feedback. A Python |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 195 | Enhancement Proposal (PEP) may be submitted if your idea gains ground. All |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 196 | 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] | 197 | `python.org/dev/peps/ <https://www.python.org/dev/peps/>`_. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 198 | |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 199 | |
Benjamin Peterson | 1da43e5 | 2009-06-26 13:21:52 +0000 | [diff] [blame] | 200 | Release Schedule |
| 201 | ---------------- |
Guido van Rossum | 1c896e3 | 2007-08-29 23:03:30 +0000 | [diff] [blame] | 202 | |
Victor Stinner | d783b01 | 2017-02-11 02:21:38 +0100 | [diff] [blame] | 203 | See :pep:`537` for Python 3.7 release details. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 204 | |
| 205 | |
| 206 | Copyright and License Information |
| 207 | --------------------------------- |
| 208 | |
Georg Brandl | a7d2f00 | 2013-03-23 16:06:13 +0100 | [diff] [blame] | 209 | 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] | 210 | 2012, 2013, 2014, 2015, 2016 Python Software Foundation. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 211 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 212 | Copyright (c) 2000 BeOpen.com. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 213 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 214 | Copyright (c) 1995-2001 Corporation for National Research Initiatives. All |
| 215 | rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 216 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 217 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 218 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 219 | See the file "LICENSE" for information on the history of this software, |
| 220 | terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 221 | |
Larry Hastings | f92f6c8 | 2015-09-12 17:28:39 +0100 | [diff] [blame] | 222 | This Python distribution contains *no* GNU General Public License (GPL) code, |
| 223 | so it may be used in proprietary projects. There are interfaces to some GNU |
| 224 | code but these are entirely optional. |
Guido van Rossum | ef0f129 | 2007-08-30 14:51:05 +0000 | [diff] [blame] | 225 | |
Georg Brandl | 260a788 | 2011-02-20 10:29:04 +0000 | [diff] [blame] | 226 | All trademarks referenced herein are property of their respective holders. |
Ned Deily | d35ee0b | 2016-09-12 17:36:57 -0400 | [diff] [blame] | 227 | |