blob: bd2735da87a520e1d73fe7da1dbc1b9fcf2598ab [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
Benjamin Peterson1da43e52009-06-26 13:21:52 +000018On Unix, Linux, BSD, OSX, and Cygwin:
19
20 ./configure
21 make
22 make test
23 sudo make install
24
25This will install Python as python3.
26
Georg Brandla02607e2010-07-31 11:00:47 +000027You 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
Georg Brandla02607e2010-07-31 11:00:47 +000031On 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
33Python executable in a place that is not normally on your PATH, you may want to
34set 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.
39For 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.
48You should do a "make clean" at the toplevel first.)
Benjamin Peterson1da43e52009-06-26 13:21:52 +000049
Gregory P. Smithaa5a13f2016-11-21 00:11:47 -080050To get an optimized build of Python, "configure --enable-optimizations" before
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +000051you 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.
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)014d52f2016-09-08 18:33:00 +000060If 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
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)14c7f712016-09-08 22:38:46 +000083Enabled via configure's --with-lto flag. LTO takes advantages of recent
84compiler toolchains ability to optimize across the otherwise arbitrary .o file
85boundary 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
Larry Hastingsf92f6c82015-09-12 17:28:39 +010092We have a comprehensive overview of the changes in the "What's New in
Ned Deily4829bc62016-09-12 17:29:04 -040093Python 3.7" document, found at
Benjamin Peterson1da43e52009-06-26 13:21:52 +000094
Ned Deily4829bc62016-09-12 17:29:04 -040095 https://docs.python.org/3.7/whatsnew/3.7.html
Benjamin Peterson1da43e52009-06-26 13:21:52 +000096
Larry Hastingsf92f6c82015-09-12 17:28:39 +010097For a more detailed change log, read Misc/NEWS (though this file, too,
98is incomplete, and also doesn't list anything merged in from the 2.7
99release under development).
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000100
101If you want to install multiple versions of Python see the section below
102entitled "Installing multiple versions".
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000103
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000104
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000105Documentation
106-------------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000107
Ned Deily4829bc62016-09-12 17:29:04 -0400108Documentation for Python 3.7 is online, updated daily:
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000109
Ned Deily4829bc62016-09-12 17:29:04 -0400110 https://docs.python.org/3.7/
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000111
Georg Brandl62069d32010-07-31 08:56:11 +0000112It can also be downloaded in many formats for faster access. The documentation
113is downloadable in HTML, PDF, and reStructuredText formats; the latter version
114is primarily for documentation authors, translators, and people with special
115formatting requirements.
Benjamin Peterson2a691a82008-03-31 01:51:45 +0000116
Ezio Melotti802bf8a2013-08-16 21:32:25 +0300117If you would like to contribute to the development of Python, relevant
118documentation is available at:
119
Ned Deilycec00a72016-05-16 16:03:51 -0400120 https://docs.python.org/devguide/
Ezio Melotti802bf8a2013-08-16 21:32:25 +0300121
122For information about building Python's documentation, refer to Doc/README.txt.
123
Guido van Rossumc07d5fa2000-09-01 22:50:02 +0000124
Barry Warsaw97f005d2008-12-03 16:46:14 +0000125Converting From Python 2.x to 3.x
Guido van Rossum1c896e32007-08-29 23:03:30 +0000126---------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000127
Georg Brandla02607e2010-07-31 11:00:47 +0000128Python starting with 2.6 contains features to help locating code that needs to
129be changed, such as optional warnings when deprecated features are used, and
130backported versions of certain key Python 3.x features.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000131
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000132A source-to-source translation tool, "2to3", can take care of the mundane task
133of converting large amounts of source code. It is not a complete solution but
134is complemented by the deprecation warnings in 2.6. See
Ned Deily4829bc62016-09-12 17:29:04 -0400135https://docs.python.org/3.7/library/2to3.html for more information.
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000136
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000137
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000138Testing
139-------
140
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100141To test the interpreter, type "make test" in the top-level directory.
142The test set produces some output. You can generally ignore the messages
143about skipped tests due to optional features which can't be imported.
144If a message is printed about a failed test or a traceback or core dump
145is produced, something is wrong.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000146
147By default, tests are prevented from overusing resources like disk space and
148memory. To enable these tests, run "make testall".
149
Georg Brandla02607e2010-07-31 11:00:47 +0000150IMPORTANT: If the tests fail and you decide to mail a bug report, *don't*
151include the output of "make test". It is useless. Run the failing test
152manually, as follows:
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000153
Antoine Pitroue7fed672010-12-14 22:06:10 +0000154 ./python -m test -v test_whatever
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000155
Georg Brandla02607e2010-07-31 11:00:47 +0000156(substituting the top of the source tree for '.' if you built in a different
157directory). This runs the test in verbose mode.
Benjamin Petersonad3d5c22009-02-26 03:38:59 +0000158
159
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000160Installing multiple versions
161----------------------------
162
163On Unix and Mac systems if you intend to install multiple versions of Python
Georg Brandla02607e2010-07-31 11:00:47 +0000164using the same installation prefix (--prefix argument to the configure script)
165you must take care that your primary python executable is not overwritten by the
166installation of a different version. All files and directories installed using
167"make altinstall" contain the major and minor version and can thus live
168side-by-side. "make install" also creates ${prefix}/bin/python3 which refers to
169${prefix}/bin/pythonX.Y. If you intend to install multiple versions using the
170same prefix you must decide which version (if any) is your "primary" version.
171Install that version using "make install". Install all other versions using
172"make altinstall".
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000173
Ned Deily190042a2016-12-23 04:10:46 -0500174For example, if you want to install Python 2.7, 3.6, and 3.7 with 3.7 being the
175primary version, you would execute "make install" in your 3.7 build directory
Georg Brandla02607e2010-07-31 11:00:47 +0000176and "make altinstall" in the others.
Christian Heimesdd15f6c2008-03-16 00:07:10 +0000177
178
Guido van Rossum1c896e32007-08-29 23:03:30 +0000179Issue Tracker and Mailing List
180------------------------------
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000181
Georg Brandla02607e2010-07-31 11:00:47 +0000182We're soliciting bug reports about all aspects of the language. Fixes are also
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100183welcome, preferably in unified diff format. Please use the issue tracker:
Fred Drake6caae142000-10-25 17:51:02 +0000184
Ned Deilycec00a72016-05-16 16:03:51 -0400185 https://bugs.python.org/
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000186
Georg Brandla02607e2010-07-31 11:00:47 +0000187If you're not sure whether you're dealing with a bug or a feature, use the
188mailing list:
Guido van Rossum1c896e32007-08-29 23:03:30 +0000189
Mark Dickinsonb9ebd042009-02-06 16:39:11 +0000190 python-dev@python.org
Guido van Rossum1c896e32007-08-29 23:03:30 +0000191
192To subscribe to the list, use the mailman form:
193
Ned Deilycec00a72016-05-16 16:03:51 -0400194 https://mail.python.org/mailman/listinfo/python-dev/
Georg Brandl81299ad2006-02-20 10:24:06 +0000195
Michael W. Hudson71dcc3e2005-02-22 15:33:26 +0000196
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000197Proposals for enhancement
198-------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000199
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000200If you have a proposal to change Python, you may want to send an email to the
Raymond Hettingera6483392016-04-17 21:21:01 -0700201comp.lang.python or python-ideas mailing lists for initial feedback. A Python
Georg Brandl260a7882011-02-20 10:29:04 +0000202Enhancement Proposal (PEP) may be submitted if your idea gains ground. All
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000203current PEPs, as well as guidelines for submitting a new PEP, are listed at
Ned Deilycec00a72016-05-16 16:03:51 -0400204https://www.python.org/dev/peps/.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000205
Guido van Rossum1c896e32007-08-29 23:03:30 +0000206
Benjamin Peterson1da43e52009-06-26 13:21:52 +0000207Release Schedule
208----------------
Guido van Rossum1c896e32007-08-29 23:03:30 +0000209
Ned Deilycec00a72016-05-16 16:03:51 -0400210See PEP 494 for release details: https://www.python.org/dev/peps/pep-0494/
Guido van Rossumef0f1292007-08-30 14:51:05 +0000211
212
213Copyright and License Information
214---------------------------------
215
Georg Brandla7d2f002013-03-23 16:06:13 +0100216Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
Benjamin Petersonf1dcdd92016-01-01 11:53:14 -06002172012, 2013, 2014, 2015, 2016 Python Software Foundation. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000218
Georg Brandl260a7882011-02-20 10:29:04 +0000219Copyright (c) 2000 BeOpen.com. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000220
Georg Brandl260a7882011-02-20 10:29:04 +0000221Copyright (c) 1995-2001 Corporation for National Research Initiatives. All
222rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000223
Georg Brandl260a7882011-02-20 10:29:04 +0000224Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000225
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100226See the file "LICENSE" for information on the history of this software,
227terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000228
Larry Hastingsf92f6c82015-09-12 17:28:39 +0100229This Python distribution contains *no* GNU General Public License (GPL) code,
230so it may be used in proprietary projects. There are interfaces to some GNU
231code but these are entirely optional.
Guido van Rossumef0f1292007-08-30 14:51:05 +0000232
Georg Brandl260a7882011-02-20 10:29:04 +0000233All trademarks referenced herein are property of their respective holders.
Ned Deilyd35ee0b2016-09-12 17:36:57 -0400234