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