-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-32996: The bulk of What's New in Python 3.7 #6978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This represents the bulk of the content for What's New in Python 3.7.
I'll start reviewing this patch later today. |
Thanks, @elprans! I'll be reviewing it this weekend as well. |
@@ -78,9 +78,6 @@ options: | |||
|
|||
Providing both of the script selection options will trigger an exception. | |||
|
|||
.. versionchanged:: 3.7.0 | |||
The exit status is non-zero if the command fails. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this was backported to 3.6 and 2.7.
Doc/whatsnew/3.7.rst
Outdated
|
||
Improved conistency of exceptions raised by :func:`issubclass` when called | ||
with a non-class and an abstract base class as the first and second | ||
arguments, respectively. (Contributed by Josh Bronson in :issue:`33018`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add a ref to optimizations section's paragraph that covers ABCMeta
being rewritten in C.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the "conistency"
Doc/whatsnew/3.7.rst
Outdated
(Contributed by Yury Selivanov in :issue:`32251`.) | ||
|
||
The new :func:`asyncio.get_running_loop` function returns the currently | ||
running loop, or ``None`` if no loop is running. This is in contrast with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be fixed: if no loop is running it raises a RuntimeError
.
Doc/whatsnew/3.7.rst
Outdated
:meth:`Future.get_loop() <asyncio.Future.get_loop>` methods | ||
return the instance of the loop on which a task or a future were created. | ||
(Contributed by Yury Selivanov in :issue:`32415`.) | ||
:meth:`Server.get_loop() <asyncio.Server.get_loop>` allows to do the same for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a new line here.
Doc/whatsnew/3.7.rst
Outdated
(Jelle Zijlstra with further improvements by INADA Naoki, Serhiy Storchaka, | ||
and Raymond Hettinger in :issue:`28638`.) | ||
|
||
Additionally, ``collections.namedtuple()`` now supports default values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove "Additionally", feels a bit out of place.
Doc/whatsnew/3.7.rst
Outdated
The new :func:`sys.get_coroutine_origin_tracking_depth` function returns | ||
the current coroutine origin tracking depth, as set by | ||
the new :func:`sys.set_coroutine_origin_tracking_depth`. | ||
(Contributed by Nathaniel J. Smith in :issue:`32591`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also mention here that asyncio now uses this new mechanism, and that this new API is intended to replace sys.set_coroutine_wrapper()
API, which is, btw, deprecated in 3.7.
|
||
C API Changes | ||
============= | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to mention PEP 567 related changes to the C API: https://www.python.org/dev/peps/pep-0567/#c-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These C APIs seem to be undocumented, BTW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add an entry together with the documentation for PEP 567 C API in a separate PR.
dynamically as specified by :pep:`560`. | ||
(Contributed by Ivan Levkivskyi in :issue:`32717`.) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some perf improvements in typing
module due to PEP 560, I would probably mention 6-7x faster import of typing
, but there are other perf improvements. They are all in the same PR #4906
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perf improvements should be in the "Optimizations" section.
Doc/whatsnew/3.7.rst
Outdated
ipaddress | ||
--------- | ||
|
||
The new ``subnet_of`` and ``superset_of`` methods of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this ought to be supernet_of
rather than superset_of
, yes?
Doc/whatsnew/3.7.rst
Outdated
|
||
:class:`~zipfile.ZipFile` now accepts the new *compresslevel* parameter to | ||
control the compression level. | ||
(Contributed by Stephen J. Turnbull. in :issue:`28102`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This references the incorrect issue - it was actually 21417, and the attribution is also scrambled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks for catching this.
Also, I'd move PEP 545 description to the top of the document (where we have all other PEPs described). @ned-deily It's a long weekend in Canada, so Elvis will be able to fix the comments here on Tuesday and I'll merge the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rendered the updated whatsnew in Sphinx and read through it in a browser. Looks good, modulo comments.
What a great Python release!
Doc/whatsnew/3.7.rst
Outdated
@@ -53,20 +55,123 @@ For full details, see the :ref:`changelog <changelog>`. | |||
so it's worth checking back even after reading earlier versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR not the time to remove this "prerelease users" note yet?
Doc/whatsnew/3.7.rst
Outdated
that would act like a normal :meth:`__getattr__` method, except that it will | ||
be defined on module *instances*. | ||
Python 3.7 allows defining :meth:`__getattr__` on modules and will call | ||
it whenever a module attribute is accessed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly misleading; like object __getattr__
, module __getattr__
is called only if the attribute is otherwise not found. So it's not called "whenever a module attribute is accessed." Suggested re-word: "...and will call it whenever a module attribute is otherwise not found."
Doc/whatsnew/3.7.rst
Outdated
method now supports now supports passing a :term:`path-like objects <path-like object>` | ||
as a socket path. (Contributed by Yury Selivanov in :issue:`32066`.) | ||
|
||
The :func:`asyncio.windows_utils.socketpair`` function has been removed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra backtick after windows_utils.socketpair
Doc/whatsnew/3.7.rst
Outdated
:func:`~contextlib.asynccontextmanager` and | ||
:class:`~contextlib.AbstractAsyncContextManager` have been added. (Contributed | ||
The new :func:`~contextlib.nullcontext` is a simpler and faster alternative | ||
to :class:`~contextlib.ExitStack` for handling simple context managers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that "handling simple context managers" is an accurate description of what nullcontext
is good for. It won't help you handle or implement a simple context manager, it's useful only as a no-op context managers. Suggested re-word: "... a simpler and faster no-op context manager than ExitStack."
Doc/whatsnew/3.7.rst
Outdated
Alexander Mohr and Ilya Kulakov in :issue:`29302`.) | ||
|
||
|
||
cProfile | ||
-------- | ||
|
||
:mod:`cProfile` command line now accepts ``-m module_name`` as an alternative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: for consistency with other entries, this sentence should start with "The ".
Doc/whatsnew/3.7.rst
Outdated
now accepts negative *limit*, truncating the result to the | ||
``abs(limit)`` oldest frames. To get the old behaviour, use | ||
the new *most_recent_first* argument to ``Traceback.format()``. | ||
(Contributed by Jesse Bakker. in :issue:`32121`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove period after "Bakker"
Doc/whatsnew/3.7.rst
Outdated
@@ -837,6 +1630,13 @@ The initialization of the default warnings filters has changed as follows: | |||
(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, | |||
:issue:`32043`, and :issue:`32230`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a period to end this sentence
Doc/whatsnew/3.7.rst
Outdated
avoid creating bound method instances. | ||
(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.) | ||
|
||
The :mod:`asyncio` received a number of notable optimizations for commonly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the word "module"
Doc/whatsnew/3.7.rst
Outdated
:meth:`dict.copy` is now up to 5.5 times faster. | ||
(Contributed by Yury Selivanov in :issue:`31179`.) | ||
|
||
:func:`hasattr` and :func:`getattr`` are now about 4 times faster when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra backtick after getattr
The :meth:`~selectors.BaseSelector.modify` methods of classes | ||
:class:`selectors.EpollSelector`, :class:`selectors.PollSelector` | ||
and :class:`selectors.DevpollSelector` may be around 10% faster under | ||
heavy loads. (Contributed by Giampaolo Rodola' in :issue:`30014`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use correct accent in contributor's name instead of trailing apostrophe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how Giampaolo is spelling his name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elprans Great work on the What's New. ☀️ I've left a few comments about typos and spelling.
Doc/whatsnew/3.7.rst
Outdated
an easy and consistent way to enter the Python debugger. | ||
|
||
Built-in ``breakpoint()`` calls :func:`sys.breakpointhook`. By default, this | ||
latter imports :mod:`pdb` and then calls ``pdb.set_trace()``, but by binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latter
Doc/whatsnew/3.7.rst
Outdated
Python 3.7 allows defining :meth:`__getattr__` on modules and will call | ||
it whenever a module attribute is accessed. | ||
|
||
A typical example of where this may be useful is attribute access deprecation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... attribute access, deprecation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually means "deprecation warnings for attribute access". I'll reword for clarity.
Doc/whatsnew/3.7.rst
Outdated
provide nanosecond resolution: they return a number of nanoseconds as a Python | ||
``int``. | ||
The new functions are similar in function to the existing functions | ||
without the ``_ns`` suffix, but instead of returning fractional seconds, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...suffix. They differ by returning nanoseconds as integers, instead of fractional seconds.
Doc/whatsnew/3.7.rst
Outdated
abc | ||
--- | ||
|
||
Improved conistency of exceptions raised by :func:`issubclass` when called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp./ consistency
Doc/whatsnew/3.7.rst
Outdated
the user intermix options and positional arguments on the command line, | ||
as is possible in many unix commands. It supports most but not all | ||
argparse features. (Contributed by paul.j3 in :issue:`14191`.) | ||
The new :meth:`ArgumentParser.parse_intermixed_args() \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As done on line 589, it probably is more readable to avoid using \
and put the method link all on one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is just the backslash that worries you, perhaps you can remove it but leave the line break in
Doc/whatsnew/3.7.rst
Outdated
|
||
Support for directly ``await``-ing instances of :class:`asyncio.Lock` and | ||
other asyncio synchronization primitives has been deprecated. An | ||
asynchronous context manager has to be used in order to acquire and release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has to must
Doc/whatsnew/3.7.rst
Outdated
The new :func:`gc.freeze`` function allows freezing all objects tracked | ||
by the garbage collector and exclude them from future collections. | ||
This can be used before a POSIX ``fork()`` call to make the GC copy-on-write | ||
friendly or to speed up collection. The new :func:`gc.unfreeze` functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is an extra period before "The new..."
Doc/whatsnew/3.7.rst
Outdated
=========================================== | ||
|
||
Function :c:func:`PySlice_GetIndicesEx` is deprecated and replaced with | ||
a macro if ``Py_LIMITED_API`` is not set or set to the value between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... is not set, is set to a value in the range between 0x03050400
and 0x03060000
(not inclusive), or is 0x03060100
or higher.
Doc/whatsnew/3.7.rst
Outdated
|
||
* Direct instantiation of :class:`ssl.SSLSocket` and :class:`ssl.SSLObject` | ||
objects is now prohibited. The constructors were never documented, tested, | ||
or designed as public constructors. Users were suppose to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp. supposed
Doc/whatsnew/3.7.rst
Outdated
|
||
* ``repr`` for :exc:`BaseException` has changed not to include trailing comma | ||
in the output. Mind that most exceptions are affected by this change. | ||
* ``repr`` for :exc:`BaseException` has changed not to include the trailing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has changed not to include has changed to exclude
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A have reviewed a small part of the PR and have many comments. Many changes should be in other sections, more brief, or not be added at all.
Doc/whatsnew/3.7.rst
Outdated
abc | ||
--- | ||
|
||
Improved conistency of exceptions raised by :func:`issubclass` when called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not worth an entry in this section. If you with, it can be added in the section "Other Language Changes" or like.
Doc/whatsnew/3.7.rst
Outdated
aifc | ||
---- | ||
|
||
Improved exceptions raised for invalid number of channels and sample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not worth be mentioned in this document at all.
Doc/whatsnew/3.7.rst
Outdated
intermixing options and positional arguments. | ||
(Contributed by paul.j3 in :issue:`14191`.) | ||
|
||
:mod:`argparse` subparsers are now required by default. This matches the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will better look in the section "Changes in the Python API".
Doc/whatsnew/3.7.rst
Outdated
ast | ||
--- | ||
|
||
:meth:`ast.literal_eval()` is now more strict. Addition and subtraction of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will better look in the section "Changes in the Python API". But I'm not sure it is worth mentioning in this document at all. This change makes the implementation closer to the documentation and will affect too little code that use literal_eval() in non-purposed way.
Doc/whatsnew/3.7.rst
Outdated
asyncio | ||
------- | ||
|
||
The new :term:`provisional <provisional api>` :func:`asyncio.run` function can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very long list. It would be better to write it in more compact form. See how long list of functions were introduced in previous releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, asyncio always have a lot of stuff in what's new. Every change here is important, please keep the section as is.
Doc/whatsnew/3.7.rst
Outdated
dictionary are now being implicitly converted to strings. | ||
(Contributed by James Tocknell. in :issue:`23835`.) | ||
|
||
The *filename* parameter of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this section.
Doc/whatsnew/3.7.rst
Outdated
csv | ||
--- | ||
|
||
A single empty field is now always quoted when written into a CSV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this section.
Doc/whatsnew/3.7.rst
Outdated
dbm | ||
--- | ||
|
||
:func:`dbm.dumb` now supports reading read-only files and no longer writes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this section. This should be in two sections: a part in minor enhancements, and a part in deprecations.
:mod:`dbm.dumb`
instead of :func:`dbm.dumb`
.
Doc/whatsnew/3.7.rst
Outdated
(Contributed by Serhiy Storchaka in :issue:`28847`.) | ||
|
||
|
||
:func:`dbm.open` now encodes filenames using the filesystem encoding rather |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix.
Doc/whatsnew/3.7.rst
Outdated
the new *depth* parameter. | ||
(Contributed by Serhiy Storchaka in :issue:`11822`.) | ||
|
||
Functions in the :mod:`dis` module now works with asynchronous generators and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this section.
Doc/whatsnew/3.7.rst
Outdated
(Contributed by Paul Ganssle in :issue:`15873`.) | ||
|
||
The :class:`tzinfo <datetime.tzinfo>` objects now supprt sub-minute offsets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be more correct to say “The tzinfo class now supports . . .”, unless there are only specific instances with the support.
Doc/whatsnew/3.7.rst
Outdated
:meth:`Future.get_loop() <asyncio.Future.get_loop>` methods | ||
return the instance of the loop on which a task or a future were created. | ||
(Contributed by Yury Selivanov in :issue:`32415`.) | ||
:meth:`Server.get_loop() <asyncio.Server.get_loop>` allows to do the same for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know allows to is awkward and incorrect grammar in English, though it crops up often. In this case I suggest something like “Server.get_loop allows doing the same . . .”, or even “Server.get_loop does the same”.
Doc/whatsnew/3.7.rst
Outdated
--- | ||
|
||
A single empty field is now always quoted when written into a CSV | ||
file. This allows to distinguish an empty row from a row consisting of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows distinguishing . . .
Doc/whatsnew/3.7.rst
Outdated
-- | ||
|
||
The new :func:`gc.freeze`` function allows freezing all objects tracked | ||
by the garbage collector and exclude them from future collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. . . and excluding them . . .
Doc/whatsnew/3.7.rst
Outdated
The improved host name check requires an OpenSSL 1.0.2 or 1.1 compatible | ||
libssl. OpenSSL 0.9.8 and 1.0.1 are no longer supported. LibreSSL is | ||
The improved host name check requires OpenSSL 1.0.2 or 1.1 compatible | ||
libssl. OpenSSL 0.9.8 and 1.0.1 are no longer supported. LibreSSL is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes more sense with “an” than without. Another way of writing it could be “. . . requires a libssl implementation compatible with Open SSL’s 1.0.2 or 1.1 APIs.”
But after reading further down, it says one of these versions is required to build (and presumably use) the SSL module in general. Which seems to make this paragraph redundant.
Doc/whatsnew/3.7.rst
Outdated
:func:`timeit.timeit` autorange now uses a single loop iteration if | ||
the benchmark takes less than 10 seconds, instead of 10 iterations. | ||
``python3 -m timeit -s 'import time' 'time.sleep(1)'`` now takes 4 seconds | ||
instead of 40 seconds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule doesn’t make sense. Maybe it should be to use a single iteration if a benchmark is slower than some value (0.2 s?). Does running sleep(11) also do a single iteration?
Doc/whatsnew/3.7.rst
Outdated
method can be used to replace the logger stream after handler creation. | ||
(Contributed by Vinay Sajip in :issue:`30522`.) | ||
|
||
It is now possible to specify keyword arguments to handler constructor in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should say handler constructors?
|
||
The :func:`math.erf` and :func:`math.erfc` functions now use the (faster) | ||
C library implementation on most platforms. | ||
(Contributed by Serhiy Storchaka in :issue:`26121`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate entry, although I prefer your version :)
Doc/whatsnew/3.7.rst
Outdated
* Due to internal changes in :mod:`socket` you won't be able to | ||
:func:`socket.fromshare` a socket :func:`~socket.socket.share`-ed in older | ||
Python versions. | ||
* Due to internal changes in :mod:`socket` calling :func:`socket.fromshare` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a comma: “Due to changes in socket, calling fromshare . . .”
@serhiy-storchaka @ned-deily Serhiy, I disagree with how you want to rewrite the asyncio section. As asyncio maintainer I like the what's new in 3.7 asyncio section, and find it similar in its size to 3.6 and 3.5. A lot of changes that you marked as "not in this section" or "not worth mentioning" are actually very subtle and must be communicated to asyncio users. I'm +1 to drop docs for aifc modules and alike as you suggested, but the asyncio section should stay as is in my opinion. |
@1st1 @serhiy-storchaka Regarding the |
If other core developer (especially the maintainer of the module) want to include some information I have no objections. |
Thanks everyone for the reviews! I updated the PR with fixes. |
Doc/whatsnew/3.7.rst
Outdated
equivalent to CR. | ||
(Contributed by Bo Bayles in :issue:`32304`.) | ||
|
||
The unused ``install_misc`` command has been removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the "Removed" section.
Doc/whatsnew/3.7.rst
Outdated
and ``platforms`` fields are not specified as a list or a string. | ||
(Contributed by Berker Peksag in :issue:`19610`.) | ||
|
||
The ``upload`` command no longer tries to change CR end-of-line characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix.
Doc/whatsnew/3.7.rst
Outdated
|
||
:class:`distutils.core.setup` now warns if the ``classifiers``, ``keywords`` | ||
and ``platforms`` fields are not specified as a list or a string. | ||
(Contributed by Berker Peksag in :issue:`19610`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and Neil Schemenauer
Doc/whatsnew/3.7.rst
Outdated
therefore included in source distributions. | ||
(Contributed by Ryan Gonzalez in :issue:`11913`.) | ||
|
||
:class:`distutils.core.setup` now warns if the ``classifiers``, ``keywords`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In "Changes in the Python API".
enum members. | ||
(Contributed by Ethan Furman in :issue:`31801`.) | ||
|
||
In Python 3.8, attempting to check for non-Enum objects in :class:`Enum` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In "Deprecated"
@@ -652,103 +1288,189 @@ can be set within the scope of a group. | |||
``'^$'`` or ``(?=-)`` that matches an empty string. | |||
(Contributed by Serhiy Storchaka in :issue:`25054`.) | |||
|
|||
Regular expressions compiled with the :const:`re.LOCALE` flag no longer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Changes in the Python API"
when the compiled regular expression is used. | ||
(Contributed by Serhiy Storchaka in :issue:`30215`.) | ||
|
||
:exc:`FutureWarning` is now emitted if a regular expression contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Changes in the Python API".
Doc/whatsnew/3.7.rst
Outdated
timeit | ||
------ | ||
|
||
:func:`timeit.timeit` autorange now uses a single loop iteration if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually many other changes were made in this issue.
types | ||
----- | ||
|
||
The new :class:`~types.WrapperDescriptorType`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge the following two entries into a single paragraph.
dynamically as specified by :pep:`560`. | ||
(Contributed by Ivan Levkivskyi in :issue:`32717`.) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perf improvements should be in the "Optimizations" section.
Doc/whatsnew/3.7.rst
Outdated
|
||
:class:`~zipfile.ZipFile` now accepts the new *compresslevel* parameter to | ||
control the compression level. | ||
(Contributed by Bo Bayle in :issue:`21417`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, looks like my last name is misspelled here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry. Will fix.
@serhiy-storchaka I agree that placing depreciations and removals together makes sense, but what is the value in splitting standard library improvements into “New” and “Changed”? |
Doc/whatsnew/3.7.rst
Outdated
|
||
|
||
binascii | ||
-------- | ||
|
||
The :func:`~binascii.b2a_uu` function now accepts an optional *backtick* | ||
keyword argument. When it's true, zeros are represented by ``'`'`` | ||
keyword argument. When it's ``True``, zeros are represented by ``'`'`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep "true". Any boolean true value switches on this feature, not just literal True
.
It is common to write "if is true" for input arguments, but "return True" for output value.
Doc/whatsnew/3.7.rst
Outdated
* The unused :mod:`distutils ```install_misc`` command has been removed. | ||
(Contributed by Eric N. Vander Weele in :issue:`29218`.) | ||
|
||
* The ``fpectl`` module has been removed. It was never enabled by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth to add a separate section for this. Seems this is the first module removal since 3.0.
Doc/whatsnew/3.7.rst
Outdated
C library implementation on most platforms. | ||
(Contributed by Serhiy Storchaka in :issue:`26121`.) | ||
|
||
Many functions and methods in the :mod:`abc` module have been reimplemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change are already documented above.
(Contributed by Jelle Zijlstra with further improvements by INADA Naoki, | ||
Serhiy Storchaka, and Raymond Hettinger in :issue:`28638`.) | ||
|
||
:meth:`date.fromordinal` and :meth:`date.fromtimestamp` are now up to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: Alternate :class:`datetime.date` constructors :meth:`~datetime.date.fromordinal` and :meth:`~datetime.date.fromtimestamp` ...
Doc/whatsnew/3.7.rst
Outdated
|
||
* Trace hooks may now opt in to receiving ``opcode`` events from the interpreter | ||
by setting the new ``f_trace_opcodes`` attribute to :const:`True` on the frame | ||
* Trace hooks may now opt out of receiving the ``line`` and ``opcode`` events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"line" may now be opted out, but "opcode" may now be opted in.
Doc/whatsnew/3.7.rst
Outdated
- Using non-integer value for selecting a plural form in :mod:`gettext` is | ||
now deprecated. It never correctly worked. (Contributed by Serhiy Storchaka | ||
in :issue:`28692`.) | ||
aifc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth to add separate subsections for modules? Most contain only a single entry. This makes the text less compact.
Doc/whatsnew/3.7.rst
Outdated
@@ -1157,6 +2077,13 @@ Changes in Python behavior | |||
exceptions. | |||
(Contributed by Yury Selivanov in :issue:`32670`.) | |||
|
|||
* :keyword:`async` and :keyword:`await` names are now reserved keywords. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this at the first place, as it is the most visible breaking change. Would be nice to add recommendations for solving problems caused by this change.
Doc/whatsnew/3.7.rst
Outdated
@@ -1214,7 +2137,7 @@ Changes in the Python API | |||
(Contributed by Serhiy Storchaka in :issue:`29192`.) | |||
|
|||
* ``Module``, ``FunctionDef``, ``AsyncFunctionDef``, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to move this entry to the beginning of the sections, as it breaks several third-party projects.
Doc/whatsnew/3.7.rst
Outdated
@@ -1289,6 +2213,10 @@ Changes in the Python API | |||
of escaping all characters other than ASCII letters, numbers, and ``'_'``. | |||
(Contributed by Serhiy Storchaka in :issue:`29995`.) | |||
|
|||
* :func:`os.listdir` and :func:`os.scandir` now emit file name as bytes when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix.
Doc/whatsnew/3.7.rst
Outdated
dictionary are now being implicitly converted to strings. | ||
(Contributed by James Tocknell in :issue:`23835`.) | ||
|
||
* :mod:`csv` will now always quote empty fields. This allows distinguishing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug fix.
New things can not break you code. Changed things can break the code that depends on the old behavior. Sometimes the boundary is not well determined. |
Remove redundant content, reclassify some entries, fix typos and address other review feedback.
Yes, and this is why we have the "Porting to Python 3.7" section, which begins with: "This section lists previously described changes and other bugfixes (emphasis mine) I think optimizing the What's New document for readability is more important than trying to make it short. Thus, repeating change descriptions in different sections is OK. |
Sorry, @elprans and @1st1, I could not cleanly backport this to |
The PR is merged now. All edits and suggestions will be addressed in separate PRs. Thanks, Elvis! |
(cherry picked from commit 63536bd) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
GH-6998 is a backport of this pull request to the 3.7 branch. |
This represents the bulk of the content for What's New in Python 3.7.
https://bugs.python.org/issue32996