blob: a2e642279301fec8dc7172c43776350922315374 [file] [log] [blame]
Ned Deily4829bc62016-09-12 17:29:04 -04001****************************
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
48This article explains the new features in Python 3.7, compared to 3.6.
49
Steve Dower3e7d93d2016-09-22 17:11:53 -070050For full details, see the :ref:`changelog <changelog>`.
Ned Deily4829bc62016-09-12 17:29:04 -040051
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
59Summary -- 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
70New Features
71============
72
73
74
75Other Language Changes
76======================
77
Serhiy Storchaka5bb8b912016-12-16 19:19:02 +020078* 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 Deily4829bc62016-09-12 17:29:04 -040081
Serhiy Storchakadd1da7f2016-12-19 18:51:37 +020082* :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 Deily4829bc62016-09-12 17:29:04 -040086
87New Modules
88===========
89
90* None yet.
91
92
93Improved Modules
94================
95
Serhiy Storchakad9c956f2017-01-11 20:13:03 +020096unittest.mock
97-------------
98
99The :const:`~unittest.mock.sentinel` attributes now preserve their identity
100when they are :mod:`copied <copy>` or :mod:`pickled <pickle>`.
101(Contributed by Serhiy Storchaka in :issue:`20804`.)
102
Ned Deily4829bc62016-09-12 17:29:04 -0400103
104Optimizations
105=============
106
Yury Selivanovf2392132016-12-13 19:03:51 -0500107* 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 Deily4829bc62016-09-12 17:29:04 -0400112
113Build and C API Changes
114=======================
115
Zachary Waref40d4dd2016-09-17 01:25:24 -0500116* 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 Deily4829bc62016-09-12 17:29:04 -0400120
Serhiy Storchaka007d7ff2016-11-22 07:58:08 +0200121* 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 Deily4829bc62016-09-12 17:29:04 -0400127
128Deprecated
129==========
130
131
132
133Removed
134=======
135
Serhiy Storchakaff3dbe92016-12-06 19:25:19 +0200136API 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 Deily4829bc62016-09-12 17:29:04 -0400141
142
143Porting to Python 3.7
144=====================
145
146This section lists previously described changes and other bugfixes
147that may require changes to your code.
148
149