From: Serhiy Storchaka Date: Tue, 6 Dec 2016 17:25:19 +0000 (+0200) Subject: Merge documentation for issue #27030 from 3.6. X-Git-Tag: v3.7.0a1~1832 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af;p=python Merge documentation for issue #27030 from 3.6. --- ff3dbe9141a8bff0e3731ce20ddc327e0b00e9af diff --cc Doc/library/re.rst index 218bbf88cf,a298d97c9c..adf3ddde23 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@@ -758,7 -758,12 +758,12 @@@ form Unmatched groups are replaced with an empty string. .. versionchanged:: 3.6 - Unknown escapes consisting of ``'\'`` and an ASCII letter now are errors. + Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter + now are errors. + - .. deprecated-removed:: 3.5 3.7 - Unknown escapes in *repl* consist of ``'\'`` and ASCII letter now raise - a deprecation warning and will be forbidden in Python 3.7. ++ .. versionchanged:: 3.7 ++ Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter ++ now are errors. .. function:: subn(pattern, repl, string, count=0, flags=0) diff --cc Doc/whatsnew/3.7.rst index d306d40357,0000000000..14285d97a6 mode 100644,000000..100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@@ -1,127 -1,0 +1,132 @@@ +**************************** + What's New In Python 3.7 +**************************** + +:Release: |release| +:Date: |today| + +.. Rules for maintenance: + + * Anyone can add text to this document. Do not spend very much time + on the wording of your changes, because your text will probably + get rewritten to some degree. + + * The maintainer will go through Misc/NEWS periodically and add + changes; it's therefore more important to add your changes to + Misc/NEWS than to this file. + + * This is not a complete list of every single change; completeness + is the purpose of Misc/NEWS. Some changes I consider too small + or esoteric to include. If such a change is added to the text, + I'll just remove it. (This is another reason you shouldn't spend + too much time on writing your addition.) + + * If you want to draw your new text to the attention of the + maintainer, add 'XXX' to the beginning of the paragraph or + section. + + * It's OK to just add a fragmentary note about a change. For + example: "XXX Describe the transmogrify() function added to the + socket module." The maintainer will research the change and + write the necessary text. + + * You can comment out your additions if you like, but it's not + necessary (especially when a final release is some months away). + + * Credit the author of a patch or bugfix. Just the name is + sufficient; the e-mail address isn't necessary. + + * It's helpful to add the bug/patch number as a comment: + + XXX Describe the transmogrify() function added to the socket + module. + (Contributed by P.Y. Developer in :issue:`12345`.) + + This saves the maintainer the effort of going through the Mercurial log + when researching a change. + +This article explains the new features in Python 3.7, compared to 3.6. + +For full details, see the :ref:`changelog `. + +.. note:: + + Prerelease users should be aware that this document is currently in draft + form. It will be updated substantially as Python 3.7 moves towards release, + so it's worth checking back even after reading earlier versions. + + +Summary -- Release highlights +============================= + +.. This section singles out the most important changes in Python 3.7. + Brevity is key. + + +.. PEP-sized items next. + + + +New Features +============ + + + +Other Language Changes +====================== + +* More than 255 arguments can now be passed to a function. + (Contributed by Serhiy Storchaka in :issue:`12844`.) + + +New Modules +=========== + +* None yet. + + +Improved Modules +================ + + +Optimizations +============= + + +Build and C API Changes +======================= + +* A full copy of libffi is no longer bundled for use when building the + :mod:`_ctypes ` module on non-OSX UNIX platforms. An installed copy + of libffi is now required when building ``_ctypes`` on such platforms. + Contributed by Zachary Ware in :issue:`27979`. + +* The fields :c:member:`name` and :c:member:`doc` of structures + :c:type:`PyMemberDef`, :c:type:`PyGetSetDef`, + :c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`, + and :c:type:`wrapperbase` are now of type ``const char *`` rather of + ``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.) + + +Deprecated +========== + + + +Removed +======= + ++API and Feature Removals ++------------------------ ++ ++* Unknown escapes consisting of ``'\'`` and an ASCII letter in replacement ++ templates for :func:`re.sub` will now cause an error. + + +Porting to Python 3.7 +===================== + +This section lists previously described changes and other bugfixes +that may require changes to your code. + + diff --cc Misc/NEWS index 15719f2729,1f47248822..e52fbdb895 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -67,145 -91,126 +67,148 @@@ Core and Builtin - Issue #28583: PyDict_SetDefault didn't combine split table when needed. Patch by Xiang Zhang. -- Issue #27243: Change PendingDeprecationWarning -> DeprecationWarning. - As it was agreed in the issue, __aiter__ returning an awaitable - should result in PendingDeprecationWarning in 3.5 and in - DeprecationWarning in 3.6. +- Issue #28128: Deprecation warning for invalid str and byte escape + sequences now prints better information about where the error + occurs. Patch by Serhiy Storchaka and Eric Smith. -- Issue #26182: Fix a refleak in code that raises DeprecationWarning. +- Issue #28509: dict.update() no longer allocate unnecessary large memory. -- Issue #28721: Fix asynchronous generators aclose() and athrow() to - handle StopAsyncIteration propagation properly. +- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug + build. -Library -------- +- Issue #28517: Fixed of-by-one error in the peephole optimizer that caused + keeping unreachable code. -- Issue #26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and - :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by - Omar Sandoval. +- Issue #28214: Improved exception reporting for problematic __set_name__ + attributes. -- Issue #28752: Restored the __reduce__() methods of datetime objects. +- Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception + loss in PyTraceBack_Here(). -- Issue #28727: Regular expression patterns, _sre.SRE_Pattern objects created - by re.compile(), become comparable (only x==y and x!=y operators). This - change should fix the issue #18383: don't duplicate warning filters when the - warnings module is reloaded (thing usually only done in unit tests). +- Issue #28183: Optimize and cleanup dict iteration. -- Issue #20572: The subprocess.Popen.wait method's undocumented - endtime parameter now raises a DeprecationWarning. +- Issue #26081: Added C implementation of asyncio.Future. + Original patch by Yury Selivanov. -- Issue #25659: In ctypes, prevent a crash calling the from_buffer() and - from_buffer_copy() methods on abstract classes like Array. +- Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). + Patch by Xiang Zhang. -- Issue #19717: Makes Path.resolve() succeed on paths that do not exist. - Patch by Vajrasky Kok +- Issue #28376: The type of long range iterator is now registered as Iterator. + Patch by Oren Milman. -- Issue #28563: Fixed possible DoS and arbitrary code execution when handle - plural form selections in the gettext module. The expression parser now - supports exact syntax supported by GNU gettext. +- Issue #28376: Creating instances of range_iterator by calling range_iterator + type now is disallowed. Calling iter() on range instance is the only way. + Patch by Oren Milman. -- Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator when - the garbage collector is invoked in other thread. Based on patch by - Sebastian Cufre. +- Issue #26906: Resolving special methods of uninitialized type now causes + implicit initialization of the type instead of a fail. -- Issue #28600: Optimize loop.call_soon. +- Issue #18287: PyType_Ready() now checks that tp_name is not NULL. + Original patch by Niklas Koep. -- Issue #28613: Fix get_event_loop() return the current loop if - called from coroutines/callbacks. +- Issue #24098: Fixed possible crash when AST is changed in process of + compiling it. -- Issue #28634: Fix asyncio.isfuture() to support unittest.Mock. +- Issue #28201: Dict reduces possibility of 2nd conflict in hash table when + hashes have same lower bits. -- Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw. +- Issue #28350: String constants with null character no longer interned. -- Issue #28639: Fix inspect.isawaitable to always return bool - Patch by Justin Mayfield. +- Issue #26617: Fix crash when GC runs during weakref callbacks. -- Issue #28652: Make loop methods reject socket kinds they do not support. +- Issue #27942: String constants now interned recursively in tuples and frozensets. -- Issue #28653: Fix a refleak in functools.lru_cache. +- Issue #28289: ImportError.__init__ now resets not specified attributes. -- Issue #28703: Fix asyncio.iscoroutinefunction to handle Mock objects. +- Issue #21578: Fixed misleading error message when ImportError called with + invalid keyword args. -- Issue #28704: Fix create_unix_server to support Path-like objects - (PEP 519). +- Issue #28203: Fix incorrect type in complex(1.0, {2:3}) error message. + Patch by Soumya Sharma. -- Issue #28720: Add collections.abc.AsyncGenerator. +- Issue #28086: Single var-positional argument of tuple subtype was passed + unscathed to the C-defined function. Now it is converted to exact tuple. -Documentation -------------- +- Issue #28214: Now __set_name__ is looked up on the class instead of the + instance. -- Issue #28513: Documented command-line interface of zipfile. +- Issue #27955: Fallback on reading /dev/urandom device when the getrandom() + syscall fails with EPERM, for example when blocked by SECCOMP. -Tests ------ +- Issue #28192: Don't import readline in isolated mode. -- Issue #28666: Now test.support.rmtree is able to remove unwritable or - unreadable directories. +- Issue #27441: Remove some redundant assignments to ob_size in longobject.c. + Thanks Oren Milman. -- Issue #23839: Various caches now are cleared before running every test file. +- Issue #27222: Clean up redundant code in long_rshift function. Thanks + Oren Milman. -Build ------ +- Upgrade internal unicode databases to Unicode version 9.0.0. -- Issue #10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and - Michael Haubenwallner. +- Issue #28131: Fix a regression in zipimport's compile_source(). zipimport + should use the same optimization level as the interpreter. -- Issue #26359: Rename --with-optimiations to --enable-optimizations. +- Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly + optimize memcpy(). -- Issue #28676: Prevent missing 'getentropy' declaration warning on macOS. - Patch by Gareth Rees. +- Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a + "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. +- Issue #26182: Raise DeprecationWarning when async and await keywords are + used as variable/attribute/class/function name. -What's New in Python 3.6.0 beta 3 -================================= +- Issue #26182: Fix a refleak in code that raises DeprecationWarning. -*Release date: 2016-10-31* +- Issue #28721: Fix asynchronous generators aclose() and athrow() to + handle StopAsyncIteration propagation properly. -Core and Builtins ------------------ +Library +------- -- Issue #28128: Deprecation warning for invalid str and byte escape - sequences now prints better information about where the error - occurs. Patch by Serhiy Storchaka and Eric Smith. ++- Issue #27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in ++ re.sub() replacement templates regular expressions now are errors. + -- Issue #28509: dict.update() no longer allocate unnecessary large memory. +- Issue #28835: Fix a regression introduced in warnings.catch_warnings(): + call warnings.showwarning() if it was overriden inside the context manager. -- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug - build. +- Issue #27172: To assist with upgrades from 2.7, the previously documented + deprecation of ``inspect.getfullargspec()`` has been reversed. This decision + may be revisited again after the Python 2.7 branch is no longer officially + supported. -- Issue #28517: Fixed of-by-one error in the peephole optimizer that caused - keeping unreachable code. +- Issue #28740: Add sys.getandroidapilevel(): return the build time API version + of Android as an integer. Function only available on Android. -- Issue #28214: Improved exception reporting for problematic __set_name__ - attributes. +- Issue #26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and + :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by + Omar Sandoval. -- Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception - loss in PyTraceBack_Here(). +- Issue #28752: Restored the __reduce__() methods of datetime objects. -- Issue #28471: Fix "Python memory allocator called without holding the GIL" - crash in socket.setblocking. +- Issue #28727: Regular expression patterns, _sre.SRE_Pattern objects created + by re.compile(), become comparable (only x==y and x!=y operators). This + change should fix the issue #18383: don't duplicate warning filters when the + warnings module is reloaded (thing usually only done in unit tests). -Library -------- +- Issue #20572: Remove the subprocess.Popen.wait endtime parameter. It was + deprecated in 3.4 and undocumented prior to that. + +- Issue #25659: In ctypes, prevent a crash calling the from_buffer() and + from_buffer_copy() methods on abstract classes like Array. + +- Issue #28548: In the "http.server" module, parse the protocol version if + possible, to avoid using HTTP 0.9 in some error responses. + +- Issue #19717: Makes Path.resolve() succeed on paths that do not exist. + Patch by Vajrasky Kok + +- Issue #28563: Fixed possible DoS and arbitrary code execution when handle + plural form selections in the gettext module. The expression parser now + supports exact syntax supported by GNU gettext. + +- Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator when + the garbage collector is invoked in other thread. Based on patch by + Sebastian Cufre. - Issue #27517: LZMA compressor and decompressor no longer raise exceptions if given empty data twice. Patch by Benjamin Fogle.