Kaydet (Commit) d9c6ab48 authored tarafından R David Murray's avatar R David Murray

merge #10968: commit threading doc changes and corresponding whatsnew entry.

It is unfortunate that the '_' names were not kept as aliases, and that RLock
was not also converted to a class, but it is now too late to change either of
those things for 3.3.
...@@ -916,7 +916,7 @@ object -- see :ref:`multiprocessing-managers`. ...@@ -916,7 +916,7 @@ object -- see :ref:`multiprocessing-managers`.
.. class:: Condition([lock]) .. class:: Condition([lock])
A condition variable: a clone of :class:`threading.Condition`. A condition variable: an alias for :class:`threading.Condition`.
If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` If *lock* is specified then it should be a :class:`Lock` or :class:`RLock`
object from :mod:`multiprocessing`. object from :mod:`multiprocessing`.
......
This diff is collapsed.
...@@ -1945,6 +1945,12 @@ of text (:issue:`13857`). ...@@ -1945,6 +1945,12 @@ of text (:issue:`13857`).
threading threading
--------- ---------
:class:`threading.Condition`, :class:`threading.Semaphore`,
:class:`threading.BoundedSempaphore`, :class:`threading.Event`, and
:class:`threading.Timer`, all of which used to be factory functions returning a
class instance, are now classes and may be subclassed. (Contributed by Éric
Araujo in :issue:`109681`).
The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword
argument to override the default behavior of inheriting the ``deamon`` flag argument to override the default behavior of inheriting the ``deamon`` flag
value from the parent thread (:issue:`6064`). value from the parent thread (:issue:`6064`).
...@@ -2331,6 +2337,10 @@ Porting Python code ...@@ -2331,6 +2337,10 @@ Porting Python code
make decisions affected by the AST version, use :attr:`sys.version_info` make decisions affected by the AST version, use :attr:`sys.version_info`
to make the decision. to make the decision.
* Code that used to work around the fact that the :mod:`threading` module used
factory functions by subclassing the private classes will need to change to
subclass the now-public classes.
Porting C code Porting C code
-------------- --------------
......
...@@ -2907,11 +2907,11 @@ Library ...@@ -2907,11 +2907,11 @@ Library
- Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod') - Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
in Python code) now finds the doc of the method. in Python code) now finds the doc of the method.
- Issue #10968: Remove indirection in threading. The public names (Thread, - Issue #10968: Remove indirection in threading. The public names (Event,
Condition, etc.) used to be factory functions returning instances of hidden Condition, etc.) used to be factory functions returning instances of hidden
classes (_Thread, _Condition, etc.), because (if Guido recalls correctly) this classes (_Event, _Condition, etc.), because (if Guido recalls correctly) this
code pre-dates the ability to subclass extension types. It is now possible to code pre-dates the ability to subclass extension types. It is now possible
inherit from Thread and other classes, without having to import the private to inherit from these classes without having to import the private
underscored names like multiprocessing did. underscored names like multiprocessing did.
- Issue #9723: Add shlex.quote functions, to escape filenames and command - Issue #9723: Add shlex.quote functions, to escape filenames and command
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment