Changelog — Python 3.7.0a0 documentation

Python 3.7.0 alpha 1

Release date: XXXX-XX-XX

Core and Builtins

  • Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
  • Issue #29337: Fixed possible BytesWarning when compare the code objects. Warnings could be emitted at compile time.
  • Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().
  • Issue #29034: Fix memory leak and use-after-free in os module (path_converter).
  • Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception.
  • Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function. Calling function is up to 5% faster.
  • Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII whitespace, not only spaces. Patch by Robert Xiao.
  • Issue #28932: Do not include <sys/random.h> if it does not exist.
  • Issue #25677: Correct the positioning of the syntax error caret for indented blocks. Based on patch by Michael Layzell.
  • Issue #29000: Fixed bytes formatting of octals with zero padding in alternate form.
  • Issue #18896: Python function can now have more than 255 parameters. collections.namedtuple() now supports tuples with more than 255 elements.
  • Issue #28596: The preferred encoding is UTF-8 on Android. Patch written by Chi Hsuan Yen.
  • Issue #26919: On Android, operating system data is now always encoded/decoded to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
  • Issue #28991: functools.lru_cache() was susceptible to an obscure reentrancy bug triggerable by a monkey-patched len() function.
  • Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
  • Issue #28739: f-string expressions are no longer accepted as docstrings and by ast.literal_eval() even if they do not include expressions.
  • Issue #28512: Fixed setting the offset attribute of SyntaxError by PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
  • Issue #28918: Fix the cross compilation of xxlimited when Python has been built with Py_DEBUG defined.
  • Issue #23722: Rather than silently producing a class that doesn’t support zero-argument super() in methods, failing to pass the new __classcell__ namespace entry up to type.__new__ now results in a DeprecationWarning and a class that supports zero-argument super().
  • Issue #28797: Modifying the class __dict__ inside the __set_name__ method of a descriptor that is used inside that class no longer prevents calling the __set_name__ method of other descriptors.
  • Issue #28799: Remove the PyEval_GetCallStats() function and deprecate the untested and undocumented sys.callstats() function. Remove the CALL_PROFILE special build: use the sys.setprofile() function, cProfile or profile to profile function calls.
  • Issue #12844: More than 255 arguments can now be passed to a function.
  • Issue #28782: Fix a bug in the implementation yield from when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (issue #26647).
  • Issue #28774: Fix error position of the unicode error in ASCII and Latin1 encoders when a string returned by the error handler contains multiple non-encodable characters (non-ASCII for the ASCII codec, characters out of the U+0000-U+00FF range for Latin1).
  • Issue #28731: Optimize _PyDict_NewPresized() to create correct size dict. Improve speed of dict literal with constant keys up to 30%.
  • Issue #28532: Show sys.version when -V option is supplied twice.
  • Issue #27100: The with-statement now checks for __enter__ before it checks for __exit__. This gives less confusing error messages when both methods are missing. Patch by Jonathan Ellington.
  • Issue #28746: Fix the set_inheritable() file descriptor method on platforms that do not have the ioctl FIOCLEX and FIONCLEX commands.
  • Issue #26920: Fix not getting the locale’s charset upon initializing the interpreter, on platforms that do not have langinfo.
  • Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X when decode astral characters. Patch by Xiang Zhang.
  • Issue #28665: Improve speed of the STORE_DEREF opcode by 40%.
  • Issue #19398: Extra slash no longer added to sys.path components in case of empty compile-time PYTHONPATH components.
  • Issue #28621: Sped up converting int to float by reusing faster bits counting implementation. Patch by Adrian Wielgosik.
  • Issue #28580: Optimize iterating split table values. Patch by Xiang Zhang.
  • Issue #28583: PyDict_SetDefault didn’t combine split table when needed. Patch by Xiang Zhang.
  • 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 #28509: dict.update() no longer allocate unnecessary large memory.
  • Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
  • Issue #28517: Fixed of-by-one error in the peephole optimizer that caused keeping unreachable code.
  • Issue #28214: Improved exception reporting for problematic __set_name__ attributes.
  • Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception loss in PyTraceBack_Here().
  • Issue #28183: Optimize and cleanup dict iteration.
  • Issue #26081: Added C implementation of asyncio.Future. Original patch by Yury Selivanov.
  • Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). Patch by Xiang Zhang.
  • Issue #28376: The type of long range iterator is now registered as Iterator. Patch by Oren Milman.
  • 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 #26906: Resolving special methods of uninitialized type now causes implicit initialization of the type instead of a fail.
  • Issue #18287: PyType_Ready() now checks that tp_name is not NULL. Original patch by Niklas Koep.
  • Issue #24098: Fixed possible crash when AST is changed in process of compiling it.
  • Issue #28201: Dict reduces possibility of 2nd conflict in hash table when hashes have same lower bits.
  • Issue #28350: String constants with null character no longer interned.
  • Issue #26617: Fix crash when GC runs during weakref callbacks.
  • Issue #27942: String constants now interned recursively in tuples and frozensets.
  • Issue #28289: ImportError.__init__ now resets not specified attributes.
  • Issue #21578: Fixed misleading error message when ImportError called with invalid keyword args.
  • Issue #28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch by Soumya Sharma.
  • Issue #28086: Single var-positional argument of tuple subtype was passed unscathed to the C-defined function. Now it is converted to exact tuple.
  • Issue #28214: Now __set_name__ is looked up on the class instead of the instance.
  • Issue #27955: Fallback on reading /dev/urandom device when the getrandom() syscall fails with EPERM, for example when blocked by SECCOMP.
  • Issue #28192: Don’t import readline in isolated mode.
  • Issue #27441: Remove some redundant assignments to ob_size in longobject.c. Thanks Oren Milman.
  • Issue #27222: Clean up redundant code in long_rshift function. Thanks Oren Milman.
  • Upgrade internal unicode databases to Unicode version 9.0.0.
  • Issue #28131: Fix a regression in zipimport’s compile_source(). zipimport should use the same optimization level as the interpreter.
  • Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
  • 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.
  • Issue #26182: Fix a refleak in code that raises DeprecationWarning.
  • Issue #28721: Fix asynchronous generators aclose() and athrow() to handle StopAsyncIteration propagation properly.
  • Issue #26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes.

Extension Modules

Source: Changelog — Python 3.7.0a0 documentation