You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better repr for multiprocessing.synchronize objects #69252
Inspired by bpo-24391 and the changes proposed to the threading module's reprs for Event, Semaphore, BoundedSemaphore, and Barrier, the corresponding objects in the multiprocessing module should have their reprs updated accordingly.
This patch implements the majority opinion from bpo-24391 for the desired format of the reprs produced by Event, Semaphore, BoundedSemaphore, and Barrier. It provides tests around each, inspired by Serhiy's preliminary patch for that same issue but adapted for multiprocessing.
These tests pass on all but 2 -- it is expected that those 2 will pass once the threading module has been similarly updated as some of the combinatoric tests leverage threading.Event in some cases and multiprocessing.Event in others (and so on for the other synchronization objects). At present, Serhiy's patch still needs updating to match the majority opinion on the repr format, hence it could not yet be applied in combination with this patch for testing. Tests thus far have been performed on OS X 10.10.3.
To Antoine's point in bpo-24391, here too, these modifications to the format of the repr are estimated to have very little impact or risk to breaking existing code.
Activity
applio commentedon Sep 11, 2015
Inspired by bpo-24391 and the changes proposed to the threading module's reprs for Event, Semaphore, BoundedSemaphore, and Barrier, the corresponding objects in the multiprocessing module should have their reprs updated accordingly.
applio commentedon Sep 11, 2015
This patch implements the majority opinion from bpo-24391 for the desired format of the reprs produced by Event, Semaphore, BoundedSemaphore, and Barrier. It provides tests around each, inspired by Serhiy's preliminary patch for that same issue but adapted for multiprocessing.
These tests pass on all but 2 -- it is expected that those 2 will pass once the threading module has been similarly updated as some of the combinatoric tests leverage threading.Event in some cases and multiprocessing.Event in others (and so on for the other synchronization objects). At present, Serhiy's patch still needs updating to match the majority opinion on the repr format, hence it could not yet be applied in combination with this patch for testing. Tests thus far have been performed on OS X 10.10.3.
applio commentedon Sep 11, 2015
To Antoine's point in bpo-24391, here too, these modifications to the format of the repr are estimated to have very little impact or risk to breaking existing code.
iritkatriel commentedon Sep 6, 2021
The patch need to be converted to a GitHub PR.
nihir27 commentedon Oct 1, 2021
Given #20534 is merged and the multiprocessing.synchronize objects inherit from the corresponding threading module objects, is this still needed?
akulakov commentedon Oct 18, 2021
Nihir: in synchronize.py, only Barrier inherits from threading.Barrier, as far as I can see. Other classes inherit from
object.pablogsal commentedon Dec 9, 2021
New changeset af6b406 by Kumar Aditya in branch 'main':
bpo-25066: Added repr for multiprocessing.Event (GH-29749)
af6b406
furkanonder commentedon May 13, 2023
@pablogsal The issue seems to have been resolved. Can we close it?