Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-43723: deprecate camelCase aliases from threading#25174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
558e66b1af898ea76261ab32c41ebe7c5228fac027aeae847File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -16,9 +16,9 @@ level :mod:`_thread` module. See also the :mod:`queue` module. | ||
| .. note:: | ||
| While they are not listed below, the ``camelCase`` names used for some | ||
| methods and functions in this module in the Python 2.x series are still | ||
| supported by this module. | ||
| In the Python 2.x series, this module contained ``camelCase`` names | ||
| for some methods and functions. These are deprecated as of Python 3.10, | ||
| but they are still supported for compatibility with Python 2.5 and lower. | ||
| .. impl-detail:: | ||
| @@ -42,6 +42,8 @@ This module defines the following functions: | ||
| Return the number of :class:`Thread` objects currently alive. The returned | ||
| count is equal to the length of the list returned by :func:`.enumerate`. | ||
| The function ``activeCount`` is a deprecated alias for this function. | ||
| .. function:: current_thread() | ||
| @@ -50,6 +52,8 @@ This module defines the following functions: | ||
| :mod:`threading` module, a dummy thread object with limited functionality is | ||
| returned. | ||
| The function ``currentThread`` is a deprecated alias for this function. | ||
| .. function:: excepthook(args, /) | ||
| @@ -381,9 +385,11 @@ since it is impossible to detect the termination of alien threads. | ||
| .. method:: getName() | ||
| setName() | ||
| Old getter/setter API for :attr:`~Thread.name`; use it directly as a | ||
| Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a | ||
| property instead. | ||
| .. deprecated:: 3.10 | ||
| .. attribute:: ident | ||
| The 'thread identifier' of this thread or ``None`` if the thread has not | ||
| @@ -433,9 +439,11 @@ since it is impossible to detect the termination of alien threads. | ||
| .. method:: isDaemon() | ||
| setDaemon() | ||
| Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a | ||
| Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as a | ||
| property instead. | ||
JelleZijlstra marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| .. deprecated:: 3.10 | ||
| .. _lock-objects: | ||
| @@ -771,6 +779,8 @@ item to the buffer only needs to wake up one consumer thread. | ||
| calling thread has not acquired the lock when this method is called, a | ||
| :exc:`RuntimeError` is raised. | ||
| The method ``notifyAll`` is a deprecated alias for this method. | ||
| .. _semaphore-objects: | ||
| @@ -908,6 +918,8 @@ method. The :meth:`~Event.wait` method blocks until the flag is true. | ||
| Return ``True`` if and only if the internal flag is true. | ||
| The method ``isSet`` is a deprecated alias for this method. | ||
| .. method:: set() | ||
| Set the internal flag to true. All threads waiting for it to become true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1070,6 +1070,27 @@ Deprecated | ||
| ``cache=shared`` query parameter. | ||
| (Contributed by Erlend E. Aasland in :issue:`24464`.) | ||
| * The following ``threading`` methods are now deprecated: | ||
| * ``threading.currentThread`` => :func:`threading.current_thread` | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't work without these empty lines? MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right, they all get mushed together into a single line | ||
| * ``threading.activeCount`` => :func:`threading.active_count` | ||
| * ``threading.Condition.notifyAll`` => | ||
| :meth:`threading.Condition.notify_all` | ||
| * ``threading.Event.isSet`` => :meth:`threading.Event.is_set` | ||
| * ``threading.Thread.setName`` => :attr:`threading.Thread.name` | ||
| * ``threading.thread.getName`` => :attr:`threading.Thread.name` | ||
| * ``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon` | ||
| * ``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon` | ||
| (Contributed by Jelle Zijlstra in :issue:`21574`.) | ||
| Removed | ||
| ======= | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| The following ``threading`` methods are now deprecated and should be replaced: | ||
| - ``currentThread`` => :func:`threading.current_thread` | ||
| - ``activeCount`` => :func:`threading.active_count` | ||
| - ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all` | ||
| - ``Event.isSet`` => :meth:`threading.Event.is_set` | ||
| - ``Thread.setName`` => :attr:`threading.Thread.name` | ||
| - ``thread.getName`` => :attr:`threading.Thread.name` | ||
| - ``Thread.isDaemon`` => :attr:`threading.Thread.daemon` | ||
| - ``Thread.setDaemon`` => :attr:`threading.Thread.daemon` | ||
| Patch by Jelle Zijlstra. |
Uh oh!
There was an error while loading. Please reload this page.