Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 1 | **************************** |
| 2 | What's New In Python 3.7 |
| 3 | **************************** |
| 4 | |
| 5 | :Release: |release| |
| 6 | :Date: |today| |
| 7 | |
| 8 | .. Rules for maintenance: |
| 9 | |
| 10 | * Anyone can add text to this document. Do not spend very much time |
| 11 | on the wording of your changes, because your text will probably |
| 12 | get rewritten to some degree. |
| 13 | |
| 14 | * The maintainer will go through Misc/NEWS periodically and add |
| 15 | changes; it's therefore more important to add your changes to |
| 16 | Misc/NEWS than to this file. |
| 17 | |
| 18 | * This is not a complete list of every single change; completeness |
| 19 | is the purpose of Misc/NEWS. Some changes I consider too small |
| 20 | or esoteric to include. If such a change is added to the text, |
| 21 | I'll just remove it. (This is another reason you shouldn't spend |
| 22 | too much time on writing your addition.) |
| 23 | |
| 24 | * If you want to draw your new text to the attention of the |
| 25 | maintainer, add 'XXX' to the beginning of the paragraph or |
| 26 | section. |
| 27 | |
| 28 | * It's OK to just add a fragmentary note about a change. For |
| 29 | example: "XXX Describe the transmogrify() function added to the |
| 30 | socket module." The maintainer will research the change and |
| 31 | write the necessary text. |
| 32 | |
| 33 | * You can comment out your additions if you like, but it's not |
| 34 | necessary (especially when a final release is some months away). |
| 35 | |
| 36 | * Credit the author of a patch or bugfix. Just the name is |
| 37 | sufficient; the e-mail address isn't necessary. |
| 38 | |
| 39 | * It's helpful to add the bug/patch number as a comment: |
| 40 | |
| 41 | XXX Describe the transmogrify() function added to the socket |
| 42 | module. |
| 43 | (Contributed by P.Y. Developer in :issue:`12345`.) |
| 44 | |
| 45 | This saves the maintainer the effort of going through the Mercurial log |
| 46 | when researching a change. |
| 47 | |
| 48 | This article explains the new features in Python 3.7, compared to 3.6. |
| 49 | |
Steve Dower | 3e7d93d | 2016-09-22 17:11:53 -0700 | [diff] [blame] | 50 | For full details, see the :ref:`changelog <changelog>`. |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 51 | |
| 52 | .. note:: |
| 53 | |
| 54 | Prerelease users should be aware that this document is currently in draft |
| 55 | form. It will be updated substantially as Python 3.7 moves towards release, |
| 56 | so it's worth checking back even after reading earlier versions. |
| 57 | |
| 58 | |
| 59 | Summary -- Release highlights |
| 60 | ============================= |
| 61 | |
| 62 | .. This section singles out the most important changes in Python 3.7. |
| 63 | Brevity is key. |
| 64 | |
| 65 | |
| 66 | .. PEP-sized items next. |
| 67 | |
| 68 | |
| 69 | |
| 70 | New Features |
| 71 | ============ |
| 72 | |
| 73 | |
| 74 | |
| 75 | Other Language Changes |
| 76 | ====================== |
| 77 | |
Serhiy Storchaka | 5bb8b91 | 2016-12-16 19:19:02 +0200 | [diff] [blame] | 78 | * More than 255 arguments can now be passed to a function, and a function can |
| 79 | now have more than 255 parameters. |
| 80 | (Contributed by Serhiy Storchaka in :issue:`12844` and :issue:`18896`.) |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 81 | |
Serhiy Storchaka | dd1da7f | 2016-12-19 18:51:37 +0200 | [diff] [blame] | 82 | * :meth:`bytes.fromhex` and :meth:`bytearray.fromhex` now ignore all ASCII |
| 83 | whitespace, not only spaces. |
| 84 | (Contributed by Robert Xiao in :issue:`28927`.) |
| 85 | |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 86 | |
| 87 | New Modules |
| 88 | =========== |
| 89 | |
| 90 | * None yet. |
| 91 | |
| 92 | |
| 93 | Improved Modules |
| 94 | ================ |
| 95 | |
Serhiy Storchaka | d9c956f | 2017-01-11 20:13:03 +0200 | [diff] [blame] | 96 | unittest.mock |
| 97 | ------------- |
| 98 | |
| 99 | The :const:`~unittest.mock.sentinel` attributes now preserve their identity |
| 100 | when they are :mod:`copied <copy>` or :mod:`pickled <pickle>`. |
| 101 | (Contributed by Serhiy Storchaka in :issue:`20804`.) |
| 102 | |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 103 | |
| 104 | Optimizations |
| 105 | ============= |
| 106 | |
Yury Selivanov | f239213 | 2016-12-13 19:03:51 -0500 | [diff] [blame] | 107 | * Added two new opcodes: ``LOAD_METHOD`` and ``CALL_METHOD`` to avoid |
| 108 | instantiation of bound method objects for method calls, which results |
| 109 | in method calls being faster up to 20%. |
| 110 | (Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.) |
| 111 | |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 112 | |
| 113 | Build and C API Changes |
| 114 | ======================= |
| 115 | |
Zachary Ware | f40d4dd | 2016-09-17 01:25:24 -0500 | [diff] [blame] | 116 | * A full copy of libffi is no longer bundled for use when building the |
| 117 | :mod:`_ctypes <ctypes>` module on non-OSX UNIX platforms. An installed copy |
| 118 | of libffi is now required when building ``_ctypes`` on such platforms. |
| 119 | Contributed by Zachary Ware in :issue:`27979`. |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 120 | |
Serhiy Storchaka | 007d7ff | 2016-11-22 07:58:08 +0200 | [diff] [blame] | 121 | * The fields :c:member:`name` and :c:member:`doc` of structures |
| 122 | :c:type:`PyMemberDef`, :c:type:`PyGetSetDef`, |
| 123 | :c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`, |
| 124 | and :c:type:`wrapperbase` are now of type ``const char *`` rather of |
| 125 | ``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.) |
| 126 | |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 127 | |
| 128 | Deprecated |
| 129 | ========== |
| 130 | |
| 131 | |
| 132 | |
| 133 | Removed |
| 134 | ======= |
| 135 | |
Serhiy Storchaka | ff3dbe9 | 2016-12-06 19:25:19 +0200 | [diff] [blame] | 136 | API and Feature Removals |
| 137 | ------------------------ |
| 138 | |
| 139 | * Unknown escapes consisting of ``'\'`` and an ASCII letter in replacement |
| 140 | templates for :func:`re.sub` will now cause an error. |
Ned Deily | 4829bc6 | 2016-09-12 17:29:04 -0400 | [diff] [blame] | 141 | |
| 142 | |
| 143 | Porting to Python 3.7 |
| 144 | ===================== |
| 145 | |
| 146 | This section lists previously described changes and other bugfixes |
| 147 | that may require changes to your code. |
| 148 | |
| 149 | |