diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2015-05-23 12:24:10 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2015-05-23 12:24:10 (GMT) |
commit | d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318 (patch) | |
tree | e92dda9e119e043482b0aa0ad1fdefff785d54c0 /Doc/whatsnew | |
parent | ec219ba1c04c4514b8b004239b1a0eac914dde4a (diff) | |
download | cpython-d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318.zip cpython-d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318.tar.gz cpython-d5cacbb1d9c3edc02bf0ba01702e7c06da5bc318.tar.bz2 |
PEP 489: Multi-phase extension module initialization
Known limitations of the current implementation:
- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet
The leak is most visible by running:
./python -m test -R3:3 test_importlib
However, you can also see it by running:
./python -X showrefcount
Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.5.rst | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index c0f9346..75bc7fb 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -93,6 +93,7 @@ Implementation improvements: (:issue:`19977`). * :pep:`488`, the elimination of ``.pyo`` files. +* :pep:`489`, multi-phase initialization of extension modules. Significantly Improved Library Modules: @@ -265,6 +266,21 @@ updated API to help with this change. :pep:`488` -- Elimination of PYO files +PEP 489: Multi-phase extension module initialization +---------------------------------------------------- + +:pep:`489` updates extension module initialization to take advantage of the +two step module loading mechanism introduced by :pep:`451` in Python 3.4. + +This change brings the import semantics of extension modules that opt-in to +using the new mechanism much closer to those of Python source and bytecode +modules, including the ability to any valid identifier as a module name, +rather than being restricted to ASCII. + +.. seealso:: + + :pep:`488` -- Multi-phase extension module initialization + Other Language Changes ====================== @@ -667,7 +683,7 @@ time tkinter ------- -* The :module:`tkinter._fix` module used for setting up the Tcl/Tk environment +* The :mod:`tkinter._fix` module used for setting up the Tcl/Tk environment on Windows has been replaced by a private function in the :module:`_tkinter` module which makes no permanent changes to environment variables. (Contributed by Zachary Ware in :issue:`20035`.) @@ -1012,7 +1028,6 @@ Changes in the Python API program depends on patching the module level variable to capture the debug output, you will need to update it to capture sys.stderr instead. - Changes in the C API -------------------- |