]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-114315: Make `threading.Lock` a real class, not a factory function (#114479)
authorNikita Sobolev <mail@sobolevn.me>
Thu, 25 Jan 2024 19:46:32 +0000 (22:46 +0300)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2024 19:46:32 +0000 (19:46 +0000)
commitd96358ff9de646dbf64dfdfed46d510da7ec4803
treeab98adc8df28364e72a0ae3ab6db75027d8ef34e
parentb52fc70d1ab3be7866ab71065bae61a03a28bfae
gh-114315: Make `threading.Lock` a real class, not a factory function (#114479)

`threading.Lock` is now the underlying class and is constructable rather than the old
factory function. This allows for type annotations to refer to it which had no non-ugly
way to be expressed prior to this.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Doc/library/threading.rst
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2024-01-23-14-11-49.gh-issue-114315.KeVdzl.rst [new file with mode: 0644]
Modules/_threadmodule.c