The idlelib package is being modernized and refactored to make IDLE look and work better and to make the code easier to understand, test, and improve. Part of making IDLE look better, especially on Linux and Mac, is using ttk widgets, mostly in the dialogs. As a result, IDLE no longer runs with tcl/tk 8.4. It now requires tcl/tk 8.5 or 8.6. We recommend running the latest release of either.
The idlelib package is being modernized and refactored to make IDLE look and
work better and to make the code easier to understand, test, and improve. Part
of making IDLE look better, especially on Linux and Mac, is using ttk widgets,
mostly in the dialogs. As a result, IDLE no longer runs with tcl/tk 8.4. It
now requires tcl/tk 8.5 or 8.6. We recommend running the latest release of
either.
'Modernizing' includes renaming and consolidation of idlelib modules. The renaming of files with partial uppercase names is similar to the renaming of, for instance, Tkinter and TkFont to tkinter and tkinter.font in 3.0. As a result, imports of idlelib files that worked in 3.5 will usually not work in 3.6. At least a module name change will be needed (see idlelib/README.txt), sometimes more. (Name changes contributed by Al Swiegart and Terry Reedy in :issue:`24225`. Most idlelib patches since have been and will be part of the process.)
'Modernizing' includes renaming and consolidation of idlelib modules. The
renaming of files with partial uppercase names is similar to the renaming of,
for instance, Tkinter and TkFont to tkinter and tkinter.font in 3.0. As a
result, imports of idlelib files that worked in 3.5 will usually not work in
3.6. At least a module name change will be needed (see idlelib/README.txt),
sometimes more. (Name changes contributed by Al Swiegart and Terry Reedy in
:issue:`24225`. Most idlelib patches since have been and will be part of the
process.)
In compensation, the eventual result with be that some idlelib classes will be easier to use, with better APIs and docstrings explaining them. Additional useful information will be added to idlelib when available.
In compensation, the eventual result with be that some idlelib classes will be
easier to use, with better APIs and docstrings explaining them. Additional
useful information will be added to idlelib when available.
importlib
---------
Import now raises the new exception :exc:`ModuleNotFoundError`
(subclass of :exc:`ImportError`) when it cannot find a module. Code
that current checks for ``ImportError`` (in try-except) will still work.
(Contributed by Eric Snow in :issue:`15767`.)
:class:`importlib.util.LazyLoader` now calls
:meth:`~importlib.abc.Loader.create_module` on the wrapped loader, removing the
restriction that :class:`importlib.machinery.BuiltinImporter` and
...
...
@@ -894,6 +1149,15 @@ restriction that :class:`importlib.machinery.BuiltinImporter` and
:term:`path-like object`.
inspect
-------
The :func:`inspect.signature() <inspect.signature>` function now reports the
implicit ``.0`` parameters generated by the compiler for comprehension and
generator expression scopes as if they were positional-only parameters called
``implicit0``. (Contributed by Jelle Zijlstra in :issue:`19611`.)
json
----
...
...
@@ -902,9 +1166,38 @@ JSON should be represented using either UTF-8, UTF-16, or UTF-32.
(Contributed by Serhiy Storchaka in :issue:`17909`.)
logging
-------
The new :meth:`WatchedFileHandler.reopenIfNeeded() <logging.handlers.WatchedFileHandler.reopenIfNeeded>`
method has been added to add the ability to check if the log file needs to
be reopened.
(Contributed by Marian Horban in :issue:`24884`.)
math
----
The tau (τ) constant has been added to the :mod:`math` and :mod:`cmath`
modules.
(Contributed by Lisa Roach in :issue:`12345`, see :pep:`628` for details.)
multiprocessing
---------------
:ref:`Proxy Objects <multiprocessing-proxy_objects>` returned by
:func:`multiprocessing.Manager` can now be nested.
(Contributed by Davin Potts in :issue:`6766`.)
os
--
See the summary for :ref:`PEP 519 <whatsnew36-pep519>` for details on how the
:mod:`os` and :mod:`os.path` modules now support
:term:`path-like objects <path-like object>`.
A new :meth:`~os.scandir.close` method allows explicitly closing a
:func:`~os.scandir` iterator. The :func:`~os.scandir` iterator now
supports the :term:`context manager` protocol. If a :func:`scandir`
...
...
@@ -919,9 +1212,21 @@ The Linux ``getrandom()`` syscall (get random bytes) is now exposed as the new
:func:`os.getrandom` function.
(Contributed by Victor Stinner, part of the :pep:`524`)
See the summary for :ref:`PEP 519 <whatsnew36-pep519>` for details on how the
:mod:`os` and :mod:`os.path` modules now support
:term:`path-like objects <path-like object>`.
pathlib
-------
:mod:`pathlib` now supports :term:`path-like objects <path-like object>`.
(Contributed by Brett Cannon in :issue:`27186`.)
See the summary for :ref:`PEP 519 <whatsnew36-pep519>` for details.
pdb
---
The :class:`~pdb.Pdb` class constructor has a new optional *readrc* argument
to control whether ``.pdbrc`` files should be read.
pickle
...
...
@@ -933,6 +1238,34 @@ Protocol version 4 already supports this case. (Contributed by Serhiy
Storchaka in :issue:`24164`.)
pickletools
-----------
:func:`pickletools.dis()` now outputs implicit memo index for the
``MEMOIZE`` opcode.
(Contributed by Serhiy Storchaka in :issue:`25382`.)
pydoc
-----
The :mod:`pydoc` module has learned to respect the ``MANPAGER``
environment variable.
(Contributed by Matthias Klose in :issue:`8637`.)
:func:`help` and :mod:`pydoc` can now list named tuple fields in the
order they were defined rather than alphabetically.
(Contributed by Raymond Hettinger in :issue:`24879`.)
random
-------
The new :func:`~random.choices` function returns a list of elements of
specified size from the given population with optional weights.
(Contributed by Raymond Hettinger in :issue:`18844`.)
re
--
...
...
@@ -945,6 +1278,11 @@ Match object groups can be accessed by ``__getitem__``, which is
equivalent to ``group()``. So ``mo['name']`` is now equivalent to
``mo.group('name')``. (Contributed by Eric Smith in :issue:`24454`.)
:class:`~re.Match` objects in the now support
:meth:`index-like objects <object.__index__>` as group
indices.
(Contributed by Jeroen Demeyer and Xiang Zhang in :issue:`27177`.)
readline
--------
...
...
@@ -966,6 +1304,16 @@ Previously, names of properties and slots which were not yet created on
an instance were excluded. (Contributed by Martin Panter in :issue:`25590`.)