diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-01-25 19:46:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 19:46:32 (GMT) |
commit | d96358ff9de646dbf64dfdfed46d510da7ec4803 (patch) | |
tree | ab98adc8df28364e72a0ae3ab6db75027d8ef34e /Doc/library/threading.rst | |
parent | b52fc70d1ab3be7866ab71065bae61a03a28bfae (diff) | |
download | cpython-d96358ff9de646dbf64dfdfed46d510da7ec4803.zip cpython-d96358ff9de646dbf64dfdfed46d510da7ec4803.tar.gz cpython-d96358ff9de646dbf64dfdfed46d510da7ec4803.tar.bz2 |
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>
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r-- | Doc/library/threading.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index b85b7f0..5fbf937 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -534,9 +534,10 @@ All methods are executed atomically. lock, subsequent attempts to acquire it block, until it is released; any thread may release it. - Note that ``Lock`` is actually a factory function which returns an instance - of the most efficient version of the concrete Lock class that is supported - by the platform. + .. versionchanged:: 3.13 + ``Lock`` is now a class. In earlier Pythons, ``Lock`` was a factory + function which returned an instance of the underlying private lock + type. .. method:: acquire(blocking=True, timeout=-1) |