Kaydet (Commit) 52fa1724 authored tarafından Georg Brandl's avatar Georg Brandl

Closes #14486: add versionchanged notices throughout the threading docs for…

Closes #14486: add versionchanged notices throughout the threading docs for PEP8-compliant APIs; the note at the top of the page is too hard to notice.
üst 21721b6b
...@@ -48,6 +48,9 @@ This module defines the following functions and objects: ...@@ -48,6 +48,9 @@ This module defines the following functions and objects:
Return the number of :class:`Thread` objects currently alive. The returned Return the number of :class:`Thread` objects currently alive. The returned
count is equal to the length of the list returned by :func:`.enumerate`. count is equal to the length of the list returned by :func:`.enumerate`.
.. versionchanged:: 2.6
Added ``active_count()`` spelling.
.. function:: Condition() .. function:: Condition()
:noindex: :noindex:
...@@ -67,6 +70,9 @@ This module defines the following functions and objects: ...@@ -67,6 +70,9 @@ This module defines the following functions and objects:
:mod:`threading` module, a dummy thread object with limited functionality is :mod:`threading` module, a dummy thread object with limited functionality is
returned. returned.
.. versionchanged:: 2.6
Added ``current_thread()`` spelling.
.. function:: enumerate() .. function:: enumerate()
...@@ -328,17 +334,19 @@ impossible to detect the termination of alien threads. ...@@ -328,17 +334,19 @@ impossible to detect the termination of alien threads.
:meth:`join` a thread before it has been started and attempts to do so :meth:`join` a thread before it has been started and attempts to do so
raises the same exception. raises the same exception.
.. method:: getName()
setName()
Old API for :attr:`~Thread.name`.
.. attribute:: name .. attribute:: name
A string used for identification purposes only. It has no semantics. A string used for identification purposes only. It has no semantics.
Multiple threads may be given the same name. The initial name is set by Multiple threads may be given the same name. The initial name is set by
the constructor. the constructor.
.. versionadded:: 2.6
.. method:: getName()
setName()
Pre-2.6 API for :attr:`~Thread.name`.
.. attribute:: ident .. attribute:: ident
The 'thread identifier' of this thread or ``None`` if the thread has not The 'thread identifier' of this thread or ``None`` if the thread has not
...@@ -358,10 +366,8 @@ impossible to detect the termination of alien threads. ...@@ -358,10 +366,8 @@ impossible to detect the termination of alien threads.
until just after the :meth:`run` method terminates. The module function until just after the :meth:`run` method terminates. The module function
:func:`.enumerate` returns a list of all alive threads. :func:`.enumerate` returns a list of all alive threads.
.. method:: isDaemon() .. versionchanged:: 2.6
setDaemon() Added ``is_alive()`` spelling.
Old API for :attr:`~Thread.daemon`.
.. attribute:: daemon .. attribute:: daemon
...@@ -374,6 +380,13 @@ impossible to detect the termination of alien threads. ...@@ -374,6 +380,13 @@ impossible to detect the termination of alien threads.
The entire Python program exits when no alive non-daemon threads are left. The entire Python program exits when no alive non-daemon threads are left.
.. versionadded:: 2.6
.. method:: isDaemon()
setDaemon()
Pre-2.6 API for :attr:`~Thread.daemon`.
.. _lock-objects: .. _lock-objects:
...@@ -602,6 +615,9 @@ needs to wake up one consumer thread. ...@@ -602,6 +615,9 @@ needs to wake up one consumer thread.
calling thread has not acquired the lock when this method is called, a calling thread has not acquired the lock when this method is called, a
:exc:`RuntimeError` is raised. :exc:`RuntimeError` is raised.
.. versionchanged:: 2.6
Added ``notify_all()`` spelling.
.. _semaphore-objects: .. _semaphore-objects:
...@@ -701,7 +717,7 @@ An event object manages an internal flag that can be set to true with the ...@@ -701,7 +717,7 @@ An event object manages an internal flag that can be set to true with the
Return true if and only if the internal flag is true. Return true if and only if the internal flag is true.
.. versionchanged:: 2.6 .. versionchanged:: 2.6
The ``is_set()`` syntax is new. Added ``is_set()`` spelling.
.. method:: set() .. method:: set()
......
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