Skip to content
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

Better repr for multiprocessing.synchronize objects #69252

Open
applio opened this issue Sep 11, 2015 · 8 comments
Open

Better repr for multiprocessing.synchronize objects #69252

applio opened this issue Sep 11, 2015 · 8 comments
Assignees
Labels
3.11 bug and security fixes easy stdlib Python modules in the Lib dir topic-multiprocessing type-feature A feature request or enhancement

Comments

@applio
Copy link
Member

applio commented Sep 11, 2015

BPO 25066
Nosy @berkerpeksag, @applio, @pablogsal, @iritkatriel, @akulakov, @kumaraditya303, @nihir27
PRs
  • bpo-25066: Added repr for multiprocessing.Event #29749
  • Dependencies
  • bpo-24391: Better repr for threading objects
  • Files
  • issue_25066_sync_objects_reprs.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/applio'
    closed_at = None
    created_at = <Date 2015-09-11.04:25:12.110>
    labels = ['easy', 'type-feature', 'library', '3.11']
    title = 'Better repr for multiprocessing.synchronize objects'
    updated_at = <Date 2021-12-09.13:16:49.676>
    user = 'https://github.com/applio'

    bugs.python.org fields:

    activity = <Date 2021-12-09.13:16:49.676>
    actor = 'pablogsal'
    assignee = 'davin'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2015-09-11.04:25:12.110>
    creator = 'davin'
    dependencies = ['24391']
    files = ['40432']
    hgrepos = []
    issue_num = 25066
    keywords = ['patch', 'easy']
    message_count = 7.0
    messages = ['250443', '250444', '250448', '401163', '403039', '404210', '408118']
    nosy_count = 9.0
    nosy_names = ['jnoller', 'sbt', 'berker.peksag', 'davin', 'pablogsal', 'iritkatriel', 'andrei.avk', 'kumaraditya', 'nihir27']
    pr_nums = ['29749']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue25066'
    versions = ['Python 3.11']

    @applio
    Copy link
    Member Author

    applio commented 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 applio self-assigned this Sep 11, 2015
    @applio applio added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Sep 11, 2015
    @applio
    Copy link
    Member Author

    applio commented 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
    Copy link
    Member Author

    applio commented 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
    Copy link
    Member

    The patch need to be converted to a GitHub PR.

    @iritkatriel iritkatriel added easy 3.11 bug and security fixes labels Sep 6, 2021
    @nihir27
    Copy link
    Mannequin

    nihir27 mannequin commented Oct 1, 2021

    Given #20534 is merged and the multiprocessing.synchronize objects inherit from the corresponding threading module objects, is this still needed?

    @akulakov
    Copy link
    Contributor

    Nihir: in synchronize.py, only Barrier inherits from threading.Barrier, as far as I can see. Other classes inherit from object.

    @pablogsal
    Copy link
    Member

    New changeset af6b406 by Kumar Aditya in branch 'main':
    bpo-25066: Added repr for multiprocessing.Event (GH-29749)
    af6b406

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @furkanonder
    Copy link
    Sponsor Contributor

    @pablogsal The issue seems to have been resolved. Can we close it?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 bug and security fixes easy stdlib Python modules in the Lib dir topic-multiprocessing type-feature A feature request or enhancement
    Projects
    Status: No status
    Development

    No branches or pull requests

    6 participants