8000 bpo-43723: deprecate camelCase aliases from threading by JelleZijlstra · Pull Request #25174 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 7 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix make check
  • Loading branch information
JelleZijlstra committed Apr 8, 2021
commit be7c522c7770538a8f3687e420c433d13c388b6d
9 changes: 5 additions & 4 deletions Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +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.
The function ``activeCount`` is a deprecated alias for this function.


.. function:: current_thread()

Expand All @@ -51,7 +52,7 @@ 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.
The function ``currentThread`` is a deprecated alias for this function.


.. function:: excepthook(args, /)
Expand Down Expand Up @@ -774,7 +775,7 @@ 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.
The method ``notifyAll`` is a deprecated alias for this method.


.. _semaphore-objects:
Expand Down Expand Up @@ -913,7 +914,7 @@ 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.
The method ``isSet`` is a deprecated alias for this method.

.. method:: set()

Expand Down
18 changes: 9 additions & 9 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1070,24 +1070,24 @@ Deprecated
``cache=shared`` query parameter.
(Contributed by Erlend E. Aasland in :issue:`24464`.)

* The following `threading` methods are now deprecated:
* The following ``threading`` methods are now deprecated:

* `threading.currentThread` => :func:`threading.current_thread`
* ``threading.currentThread`` => :func:`threading.current_thread`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work without these empty lines?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.activeCount`` => :func:`threading.active_count`

* `threading.Condition.notifyAll` =>
* ``threading.Condition.notifyAll`` =>
:meth:`threading.Condition.notify_all`

* `threading.Event.isSet` => :meth:`threading.Event.is_set`
* ``threading.Event.isSet`` => :meth:`threading.Event.is_set`

* `threading.Thread.setName` => :attr:`threading.Thread.name`
* ``threading.Thread.setName`` => :attr:`threading.Thread.name`

* `threading.thread.getName` => :attr:`threading.Thread.name`
* ``threading.thread.getName`` => :attr:`threading.Thread.name`

* `threading.Thread.isDaemon` => :attr:`threading.Thread.daemon`
* ``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`

* `threading.Thread.setDaemon` => :attr:`threading.Thread.daemon`
* ``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`

(Contributed by Jelle Zijlstra in :issue:`21574`.)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
The following `threading` methods are now deprecated and should be replaced:
The following ``threading`` methods are now deprecated and should be replaced:

- `currentThread` => :func:`threading.current_thread`
- ``currentThread`` => :func:`threading.current_thread`

- `activeCount` => :func:`threading.active_count`
- ``activeCount`` => :func:`threading.active_count`

- `Condition.notifyAll` => :meth:`threading.Condition.notify_all`
- ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all`

- `Event.isSet` => :meth:`threading.Event.is_set`
- ``Event.isSet`` => :meth:`threading.Event.is_set`

- `Thread.setName` => :attr:`threading.Thread.name`
- ``Thread.setName`` => :attr:`threading.Thread.name`

- `thread.getName` => :attr:`threading.Thread.name`
- ``thread.getName`` => :attr:`threading.Thread.name`

- `Thread.isDaemon` => :attr:`threading.Thread.daemon`
- ``Thread.isDaemon`` => :attr:`threading.Thread.daemon`

- `Thread.setDaemon` => :attr:`threading.Thread.daemon`
- ``Thread.setDaemon`` => :attr:`threading.Thread.daemon`

Patch by Jelle Zijlstra.
0