blob: a34373f3518eac6de2e691ef27655ea277aaf5cf [file] [log] [blame]
Ned Deily4829bc62016-09-12 17:29:04 -04001This is Python version 3.7.0 alpha 1
2====================================
Guido van Rossum91447632000-04-11 17:11:09 +00003
Benjamin Petersonf606e682011-12-31 22:42:26 -06004Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
Benjamin Petersone527dd32017-01-01 22:04:13 -060052012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights
6reserved.
Guido van Rossum4405cf32007-08-30 17:16:55 +00007
Larry Hastingsf92f6c82015-09-12 17:28:39 +01008Python 3.x is a new version of the language, which is incompatible with the
92.x line of releases. The language is mostly the same, but many details,
10especially how built-in objects like dictionaries and strings work,
11have changed considerably, and a lot of deprecated features have finally
12been removed.
Guido van Rossum1c896e32007-08-29 23:03:30 +000013
Guido van Rossum50e9fb92006-08-17 05:42:55 +000014
Benjamin Peterson1da43e52009-06-26 13:21:52 +000015Build Instructions
16------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000017
Victor Stinnerd783b012017-02-11 02:21:38 +010018On Unix, Linux, BSD, OSX, and Cygwin::
Benjamin Peterson1da43e52009-06-26 13:21:52 +000019
20 ./configure
21 make
22 make test
23 sudo make install
24
25This will install Python as python3.
26
Victor Stinnerd783b012017-02-11 02:21:38 +010027You can pass many options to the configure script; run ``./configure --help`` to
28find out more. On OSX and Cygwin, the executable is called ``python.exe``;
29elsewhere it's just ``python``.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000030
Victor Stinnerd783b012017-02-11 02:21:38 +010031On Mac OS X, if you have configured Python with ``--enable-framework``, you should
32use ``make frameworkinstall`` to do the installation. Note that this installs the
Georg Brandla02607e2010-07-31 11:00:47 +000033Python executable in a place that is not normally on your PATH, you may want to
Victor Stinnerd783b012017-02-11 02:21:38 +010034set up a symlink in ``/usr/local/bin``.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000035
36On Windows, see PCbuild/readme.txt.
37
Larry Hastingsf92f6c82015-09-12 17:28:39 +010038If you wish, you can create a subdirectory and invoke configure from there.
Victor Stinnerd783b012017-02-11 02:21:38 +010039For example::
Benjamin Peterson1da43e52009-06-26 13:21:52 +000040
41 mkdir debug
42 cd debug
43 ../configure --with-pydebug
44 make
45 make test
46
Larry Hastingsf92f6c82015-09-12 17:28:39 +010047(This will fail if you *also* built at the top-level directory.
Victor Stinnerd783b012017-02-11 02:21:38 +010048You should do a ``make clean`` at the toplevel first.)
Benjamin Peterson1da43e52009-06-26 13:21:52 +000049
Victor Stinnerd783b012017-02-11 02:21:38 +010050To get an optimized build of Python, ``configure --enable-optimizations`` before
51you run ``make``. This sets the default make targets up to enable Profile Guided
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)14c7f712016-09-08 22:38:46 +000052Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO)
53on some platforms. For more details, see the sections bellow.
Brett Cannon7188a3e2015-09-18 15:13:44 -070054
55
56Profile Guided Optimization
57---------------------------
58
59PGO takes advantage of recent versions of the GCC or Clang compilers.
Victor Stinnerd783b012017-02-11 02:21:38 +010060If ran, ``make profile-opt`` will do several steps.
Brett Cannon7188a3e2015-09-18 15:13:44 -070061
62First, the entire Python directory is cleaned of temporary files that
Martin Panter8d56c022016-05-29 04:13:35 +000063may have resulted in a previous compilation.
Brett Cannon7188a3e2015-09-18 15:13:44 -070064
65Then, an instrumented version of the interpreter is built, using suitable
66compiler flags for each flavour. Note that this is just an intermediary
67step and the binary resulted after this step is not good for real life
68workloads, as it has profiling instructions embedded inside.
69
70After this instrumented version of the interpreter is built, the Makefile
71will automatically run a training workload. This is necessary in order to
72profile the interpreter execution. Note also that any output, both stdout
Raymond Hettinger15f44ab2016-08-30 10:47:49 -070073and stderr, that may appear at this step is suppressed.
Brett Cannon7188a3e2015-09-18 15:13:44 -070074
75Finally, the last step is to rebuild the interpreter, using the information
Martin Pantercc71a792016-04-05 06:19:42 +000076collected in the previous one. The end result will be a Python binary
Brett Cannon7188a3e2015-09-18 15:13:44 -070077that is optimized and suitable for distribution or production installation.
78
Benjamin Peterson1da43e52009-06-26 13:21:52 +000079
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +000080Link Time Optimization
81----------------------
82
Victor Stinnerd783b012017-02-11 02:21:38 +010083Enabled via configure's ``--with-lto`` flag. LTO takes advantages of recent
84compiler toolchains ability to optimize across the otherwise arbitrary ``.o`` file
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)14c7f712016-09-08 22:38:46 +000085boundary when building final executables or shared libraries for additional
86performance gains.
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +000087
88
Benjamin Peterson1da43e52009-06-26 13:21:52 +000089What's New
90----------
91
Victor Stinnerd783b012017-02-11 02:21:38 +010092We have a comprehensive overview of the changes in the `What's New in
93Python 3.7 <https://docs.python.org/3.7/whatsnew/3.7.html>`_ document.
Benjamin Peterson1da43e52009-06-26 13:21:52 +000094
Larry Hastingsf92f6c82015-09-12 17:28:39 +010095For a more detailed change log, read Misc/NEWS (though this file, too,
96is incomplete, and also doesn't list anything merged in from the 2.7
97release under development).
Benjamin Peterson1da43e52009-06-26 13:21:52 +000098
99If you want to install multiple versions of Python see the section below
100entitled "Installing multiple versions".
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000101
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000102
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000103Documentation
104-------------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000105
Victor Stinnerd783b012017-02-11 02:21:38 +0100106`Documentation for Python 3.7 <https://docs.python.org/3.7/>`_ is online,
107updated daily.
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000108
Georg Brandl62069d32010-07-31 08:56:11 +0000109It can also be downloaded in many formats for faster access. The documentation
110is downloadable in HTML, PDF, and reStructuredText formats; the latter version
111is primarily for documentation authors, translators, and people with special
112formatting requirements.
Benjamin Peterson2a691a82008-03-31 01:51:45 +0000113
Ezio Melotti802bf8a2013-08-16 21:32:25 +0300114If you would like to contribute to the development of Python, relevant
Victor Stinnerd783b012017-02-11 02:21:38 +0100115documentation is available at: `Python Developer's Guide
116<https://docs.python.org/devguide/>`_.
Ezio Melotti802bf8a2013-08-16 21:32:25 +0300117
118For information about building Python's documentation, refer to Doc/README.txt.
119
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000120
Barry Warsaw97f005d2008-12-03 16:46:14 +0000121Converting From Python 2.x to 3.x
Guido van Rossum1c896e32007-08-29 23:03:30 +0000122---------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000123
Georg Brandla02607e2010-07-31 11:00:47 +0000124Python starting with 2.6 contains features to help locating code that needs to
125be changed, such as optional warnings when deprecated features are used, and
126backported versions of certain key Python 3.x features.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000127
Victor Stinnerd783b012017-02-11 02:21:38 +0100128A source-to-source translation tool, ``2to3``, can take care of the mundane task
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000129of converting large amounts of source code. It is not a complete solution but
130is complemented by the deprecation warnings in 2.6. See
Victor Stinnerd783b012017-02-11 02:21:38 +0100131`2to3 documentation <https://docs.python.org/3.7/library/2to3.html>`_ for more
132information.
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000133
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000134
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000135Testing
136-------
137
Victor Stinnerd783b012017-02-11 02:21:38 +0100138To test the interpreter, type ``make test`` in the top-level directory.
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100139The test set produces some output. You can generally ignore the messages
140about skipped tests due to optional features which can't be imported.
141If a message is printed about a failed test or a traceback or core dump
142is produced, something is wrong.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000143
144By default, tests are prevented from overusing resources like disk space and
Victor Stinnerd783b012017-02-11 02:21:38 +0100145memory. To enable these tests, run ``make testall``.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000146
Georg Brandla02607e2010-07-31 11:00:47 +0000147IMPORTANT: If the tests fail and you decide to mail a bug report, *don't*
Victor Stinnerd783b012017-02-11 02:21:38 +0100148include the output of ``make test``. It is useless. Run the failing test
149manually, as follows::
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000150
Antoine Pitroue7fed672010-12-14 22:06:10 +0000151 ./python -m test -v test_whatever
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000152
Georg Brandla02607e2010-07-31 11:00:47 +0000153(substituting the top of the source tree for '.' if you built in a different
154directory). This runs the test in verbose mode.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000155
156
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000157Installing multiple versions
158----------------------------
159
160On Unix and Mac systems if you intend to install multiple versions of Python
Victor Stinnerd783b012017-02-11 02:21:38 +0100161using the same installation prefix (``--prefix`` argument to the configure script)
Georg Brandla02607e2010-07-31 11:00:47 +0000162you must take care that your primary python executable is not overwritten by the
163installation of a different version. All files and directories installed using
Victor Stinnerd783b012017-02-11 02:21:38 +0100164``make altinstall`` contain the major and minor version and can thus live
165side-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 Brandla02607e2010-07-31 11:00:47 +0000167same prefix you must decide which version (if any) is your "primary" version.
Victor Stinnerd783b012017-02-11 02:21:38 +0100168Install that version using ``make install``. Install all other versions using
169``make altinstall``.
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000170
Ned Deily190042a2016-12-23 04:10:46 -0500171For example, if you want to install Python 2.7, 3.6, and 3.7 with 3.7 being the
Victor Stinnerd783b012017-02-11 02:21:38 +0100172primary version, you would execute ``make install`` in your 3.7 build directory
173and ``make altinstall`` in the others.
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000174
175
Guido van Rossum1c896e32007-08-29 23:03:30 +0000176Issue Tracker and Mailing List
177------------------------------
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000178
Georg Brandla02607e2010-07-31 11:00:47 +0000179We're soliciting bug reports about all aspects of the language. Fixes are also
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100180welcome, preferably in unified diff format. Please use the issue tracker:
Victor Stinnerd783b012017-02-11 02:21:38 +0100181`bugs.python.org <https://bugs.python.org/>`_.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000182
Georg Brandla02607e2010-07-31 11:00:47 +0000183If you're not sure whether you're dealing with a bug or a feature, use the
Victor Stinnerd783b012017-02-11 02:21:38 +0100184mailing list: python-dev@python.org. To subscribe to the list, use the mailman
185form: `python-dev <https://mail.python.org/mailman/listinfo/python-dev/>`_
Georg Brandl81299ad2006-02-20 10:24:06 +0000186
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000187
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000188Proposals for enhancement
189-------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000190
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000191If you have a proposal to change Python, you may want to send an email to the
Victor Stinnerd783b012017-02-11 02:21:38 +0100192comp.lang.python or
193`python-ideas <https://mail.python.org/mailman/listinfo/python-ideas/>`_
194mailing lists for initial feedback. A Python
Georg Brandl260a7882011-02-20 10:29:04 +0000195Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000196current PEPs, as well as guidelines for submitting a new PEP, are listed at
Victor Stinnerd783b012017-02-11 02:21:38 +0100197`python.org/dev/peps/ <https://www.python.org/dev/peps/>`_.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000198
Guido van Rossum1c896e32007-08-29 23:03:30 +0000199
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000200Release Schedule
201----------------
Guido van Rossum1c896e32007-08-29 23:03:30 +0000202
Victor Stinnerd783b012017-02-11 02:21:38 +0100203See :pep:`537` for Python 3.7 release details.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000204
205
206Copyright and License Information
207---------------------------------
208
Georg Brandla7d2f002013-03-23 16:06:13 +0100209Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
Benjamin Petersonf1dcdd92016-01-01 11:53:14 -06002102012, 2013, 2014, 2015, 2016 Python Software Foundation. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000211
Georg Brandl260a7882011-02-20 10:29:04 +0000212Copyright (c) 2000 BeOpen.com. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000213
Georg Brandl260a7882011-02-20 10:29:04 +0000214Copyright (c) 1995-2001 Corporation for National Research Initiatives. All
215rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000216
Georg Brandl260a7882011-02-20 10:29:04 +0000217Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000218
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100219See the file "LICENSE" for information on the history of this software,
220terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000221
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100222This Python distribution contains *no* GNU General Public License (GPL) code,
223so it may be used in proprietary projects. There are interfaces to some GNU
224code but these are entirely optional.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000225
Georg Brandl260a7882011-02-20 10:29:04 +0000226All trademarks referenced herein are property of their respective holders.
Ned Deilyd35ee0b2016-09-12 17:36:57 -0400227