[New-bugs-announce] [issue40797] multiprocessing.Semaphore has undocumented get_value() method

Rémi Lapeyre report at bugs.python.org
Wed May 27 16:27:22 EDT 2020


New submission from Rémi Lapeyre <remi.lapeyre at henki.fr>:

The threading.Semaphore class does not have this method, it is undocumented and useless on some system (at least MacOS):

>>> s.get_value()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/synchronize.py", line 129, in get_value
    return self._semlock._get_value()
NotImplementedError



The implementation is at https://github.com/python/cpython/blob/master/Modules/_multiprocessing/semaphore.c#L537-L553

I think this method could be removed, since it's undocumented and probably not used can I just remove it or does it need a deprecation cycle?

----------
components: Library (Lib)
messages: 370128
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: multiprocessing.Semaphore has undocumented get_value() method
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40797>
_______________________________________


More information about the New-bugs-announce mailing list